Question

I am tring to play a .swf in silverlight5 page.I am using the ListBox control or Image Control Or Any Idea To Play swf File in Silvarlight

<Image Grid.Row="0" Name="bottom_video" Height="80" Source="{Binding VodeoUrl,Mode=OneWay}" Margin="0,20,0,0" /> 
Was it helpful?

Solution 2

You can see in the code below how to use Iframe on Silverlight:

<Grid x:Name="LayoutRoot">

        <HyperlinkButton Content="HyperlinkButton" Height="23" HorizontalAlignment="Left" Margin="44,20,0,0" Name="hyperlinkButton1" VerticalAlignment="Top" Width="100" TargetName="" Click="hyperlinkButton1_Click"  />

    </Grid>



code behind:



private void hyperlinkButton1_Click(object sender, RoutedEventArgs e)        { 



HtmlDocument _document = HtmlPage.Document;


            HtmlElement iframe = _document.CreateElement("IFRAME");
            iframe.SetAttribute("src", "http://localhost:52878/TestForm.aspx");


            iframe.SetStyleAttribute("position", "absolute");
            iframe.SetStyleAttribute("top", "100px");
            iframe.SetStyleAttribute("left", "200px");
            HtmlElement body = (HtmlElement)_document.GetElementsByTagName("BODY")[0];
            body.AppendChild(iframe);

HtmlDocument _document = HtmlPage.Document;

            HtmlElement iframe = _document.CreateElement("IFRAME");

            iframe.SetAttribute("src", "http://localhost:52878/TestForm.aspx");

            iframe.SetStyleAttribute("position", "absolute");

            iframe.SetStyleAttribute("top", "100px");

            iframe.SetStyleAttribute("left", "200px");

            HtmlElement body = (HtmlElement)_document.GetElementsByTagName("BODY")[0];

            body.AppendChild(iframe);

}

OTHER TIPS

You might be able use the the Flash ActiveX control that is automatically installed with the flash player itself on every windows machine but if it works it'd still comes with a lot of limitations as stated here another problem will be the "Airspace" problem.

Another way is to convert the SWF to XAML using this. But I found quite a lot of swf files that couldn't be converted. Especially if there is a lot of ActionScript or dynamic loading of content involved.

I've got the answer for how to play an swf file in Silverlight 5

 <WebBrowser Grid.Row="1" VerticalAlignment="Top" Source="{Binding VodeoUrl,Mode=OneWay}" Height="280" Width="280"/>

This is impossible. Silverlight does not play swf files. If it is just a video file without any interaction, you might be able to convert the video to something that Silverlight can play. Here is some information about the supported formats:
http://msdn.microsoft.com/en-us/library/cc189080%28v=vs.95%29.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top