Select to view content in your preferred language

Video watching

1520
8
06-10-2011 08:38 AM
JayKappy
Frequent Contributor
I am tryign to figure out what to do here...I have a Featuer class point that I want to be able to hover over and map tip it....THIS I CAN DO.
Next step is I want one of the options to allow me to show a PDF...THIS I CAN DO

What I need to figure out is to have a video play....for that point...

1. Do i need to import each video into the Silverlight app?
2. How would I access all those videos?  Put a URL or link in one of the fields (Attributes)

How would I view the video in its own window and specify the size....
0 Kudos
8 Replies
JayKappy
Frequent Contributor
I made a folder for all my images and simply pointed to that folder and show the image in its own window....I shoudl be able to do somethign similar????

Just a little stuck here.....
0 Kudos
JayKappy
Frequent Contributor
I was looking at thsi but I have a feature class that has the video name...I need to bind that name and then get the video from teh Video folder in the project and open it....????

http://www.dotnetcurry.com/ShowArticle.aspx?ID=177
0 Kudos
JayKappy
Frequent Contributor
Ok I am here now

I have a button that does nothing....
I hard coded the mp4 file in the media element BUT CANNOT figure out how to bind it to a attribute (fieldValue)...the attribute field value has "/Videos/halo.mp4" in it....

This is sort of working BUT

1.  I want the button or hyperlink to fire off the video...not have it just start up when the tool tip opens...
2. how do I bind this to the feature classes attribute value not hard coded?

THanks

<StackPanel Orientation="Horizontal">                                                  
     <Button x:Name="btnShow" Click="btnShow_Click" Height="25" Width="50" Content="Load Media"></Button>
     <MediaElement x:Name="mediaEle" Height="150" Source="/Videos/halo.mp4" Width="150"></MediaElement>
</StackPanel>
0 Kudos
JayKappy
Frequent Contributor
I tried this to bind to the field value but now the video does not show up....in the last post it was workign but that was hard coded....

  <MediaElement x:Name="mediaEle" Height="225" Margin="10,0,20,0" Source="{Binding [Video]}" Width="300"></MediaElement>



   <MediaElement x:Name="mediaEle" Height="225" Margin="10,0,20,0" Source="{Binding Attributes[Video]}" Width="300"></MediaElement> 


Any thoughts? Neither work....
0 Kudos
JayKappy
Frequent Contributor
I think that binding code above works....for some reason Its not workgin from a specifc field I created...I can place the path to the video in another field and it works....
I named the field Video and it does not work....

I have no idea whats wrong with this field, why I cannot return values from it.....while I can return values from everyother field in the FC...

ugggggggggggggggg....
0 Kudos
JayKappy
Frequent Contributor
I have made some good progress here...
The below Code works great....it shows the video and has the pause, stop and play button

BUT I want to move the code to a MapTip....As Soon AS I do that the video still plays BUT the code on the buttons NO Longer works....


<Grid>
       <Canvas>
            <MediaElement x:Name="mPlayer" Width="640" Height="480" Source="/Videos/halo.mp4" />
            <Button x:Name="bPlay" Background="Green" Width="100" Height="45" Canvas.Left="8" Canvas.Top="497" Content="Play" Click="bPlay_Click" />
            <Button x:Name="bPause" Background="Yellow" Width="100" Height="45" Canvas.Left="112" Canvas.Top="497" Content="Pause" Click="bPause_Click" />
            <Button x:Name="bStop" Background="Red" Width="100" Height="45" Canvas.Left="216" Canvas.Top="497" Content="Stop" Click="bStop_Click" />
      </Canvas>
</Grid>


    Private Sub bPlay_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
        MessageBox.Show("Playing")
        mPlayer.Stop()
        mPlayer.Play()
    End Sub

    Private Sub bPause_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
        MessageBox.Show("Pausing")
        If mPlayer.CurrentState = MediaElementState.Paused Then
            mPlayer.Play()
        Else
            mPlayer.Pause()
        End If
    End Sub

    Private Sub bStop_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
        MessageBox.Show("Stoping")
        mPlayer.Stop()
    End Sub



Why does the code on the buttons below stop working when its placed in a Map Tip?
The video still plays but the code that is on the buttons to pause, Stop and PLay no longer works...????????

I get the messagebox returns in the VB code seen above....so I know that the button click is getting me there and reading the code, thus returing me an alert...but the action on the mPlayer is not working in the code....Maybe because its buried in the Map Tip?????

<esri:FeatureLayer ID="M_Stops" Visible="False" 
       Url="http://gi/arcgis/rest/services/MG_Test/MapServer/8" 
       Renderer="{StaticResource UniqueRenderer}">
    <esri:FeatureLayer.OutFields>
       <sys:String>ELEM_TEXT</sys:String>
       <sys:String>Route</sys:String>
       <sys:String>Location</sys:String>
    </esri:FeatureLayer.OutFields>
    <esri:FeatureLayer.MapTip >
        <Border esri:GraphicsLayer.MapTipHideDelay="00:00:01.5" CornerRadius="10" 
               BorderBrush="#FF222957" BorderThickness="0" Margin="0,0,15,15">
           <Border.Background>
           <LinearGradientBrush EndPoint="1.038,1.136" StartPoint="0.015,0.188">
             <GradientStop Color="#FFD1DFF2"/>
             <GradientStop Color="#FF092959" Offset="0.946"/>
           </LinearGradientBrush>
         </Border.Background>
         <Border.Effect>
         <DropShadowEffect ShadowDepth="10" BlurRadius="14" Direction="300" />
         </Border.Effect>
     <Grid>
        <StackPanel Orientation="Vertical" Margin="10,10,0,10" VerticalAlignment="Center">
            <StackPanel Orientation="Vertical">
              <!--<Grid>-->
                  <!--<Canvas>-->                      
                      <MediaElement x:Name="mPlayer" Width="225" Height="300" Source="/Videos/halo.mp4" />
                      <Button x:Name="bPlay" Background="Green" Width="100" Height="45" Canvas.Left="8" Canvas.Top="497" Content="Play" Click="bPlay_Click" />
                      <Button x:Name="bPause" Background="Yellow"  Width="100" Height="45" Canvas.Left="112" Canvas.Top="497" Content="Pause" Click="bPause_Click" />
                      <Button x:Name="bStop"  Background="Red" Width="100" Height="45" Canvas.Left="216" Canvas.Top="497" Content="Stop" Click="bStop_Click" />
                  <!--</Canvas>-->
              <!--</Grid>-->             
            </StackPanel>
        </StackPanel> 
     </Grid>    
     </Border>
   </esri:FeatureLayer.MapTip>
 </esri:FeatureLayer>
0 Kudos
JayKappy
Frequent Contributor
Just cant figure out why it will work in the map but not in the MapTip??

uggggggg....anyone?
0 Kudos
JayKappy
Frequent Contributor
I dont know whats going on here....from within the Map Tip I can get the buttons to Play, Pause, and Stop the MediaElement in the map....BUT i cannot get the buttons to Play, Pause or Stop the mediaElement in the Map Tip...

Maybe this is not possible?  Anyone?
0 Kudos