我特林發揮silverlight5 page.I一個.swf現在用的ListBox控件或圖像控制 或者任何想法要Silvarlight如何在Silverlight中播放swf文件?
<Image Grid.Row="0" Name="bottom_video" Height="80" Source="{Binding VodeoUrl,Mode=OneWay}" Margin="0,20,0,0" />
我特林發揮silverlight5 page.I一個.swf現在用的ListBox控件或圖像控制 或者任何想法要Silvarlight如何在Silverlight中播放swf文件?
<Image Grid.Row="0" Name="bottom_video" Height="80" Source="{Binding VodeoUrl,Mode=OneWay}" Margin="0,20,0,0" />
您可以在下面如何在Silverlight中使用iframe代碼中看到:
<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);
}
這是不可能的播放SWF文件。 Silverlight不播放swf文件。如果它只是一個沒有任何交互的視頻文件,那麼您可以將視頻轉換爲Silverlight可以播放的內容。下面是關於支持格式的一些信息:
http://msdn.microsoft.com/en-us/library/cc189080%28v=vs.95%29.aspx
任何想法轉換SWF文件等等...格式的C#代碼? –
對不起,我不認爲這是可能的。除非你能找到一個可以進行轉換的API的第三方組件。但我認爲這樣的組成部分不太可能存在。 –
您可能能夠使用自動與Flash Player本身每一個Windows機器上安裝,但如果它的工作原理仍然會自帶的Flash ActiveX控件播放here的另一個問題將是"Airspace" problem。
另一種方法是使用this將SWF轉換爲XAML。但是我發現了很多無法轉換的swf文件。特別是如果有很多ActionScript或涉及內容的動態加載。
+1對於您的努力謝謝!!!!!!!!!!! –
我已經得到了任何控制如何在Silverlight 5
<WebBrowser Grid.Row="1" VerticalAlignment="Top" Source="{Binding VodeoUrl,Mode=OneWay}" Height="280" Width="280"/>
爲了完整起見,我們應該補充一點,這是與我在這個問題的答案中提到的限制(http://stackoverflow.com/a/14495506/4227) – bitbonk
你沒有給出這個問題所以我'會給你Upvot但被我接受 –
發揮swf文件的答案播放SWF文件在Silvarlight5然後建議我請 –
什麼關於http://stackoverflow.com/questions/801304/embed-flash-in-silverlight –
是我想玩正確的解決方案播放swf文件在Silvarlight 5 –