如何嵌入 Twitch/Youtube/Facebook 游戏流?
How to embed Twitch/Youtube/Facebook gaming stream?
我正在开发 WPF 应用程序并尝试嵌入 twitch/youtube/facebook 游戏流。总的来说,我对 WPF 应用程序比较陌生。
我已使用 Twitch 嵌入代码按照 Twitch Embed API Page, and attempted to insert it into a CEFSharp window 中列出的步骤进行操作。然而,截至 2020 年,twitch 现在需要一个“父”字段来嵌入他们的视频,所以我只是尝试将实际的 twitch 页面插入 CEFsharp 元素,但它仍然给我一个错误。
对于 Facebook 和 Youtube,我也可以让嵌入的帧显示出来,但它们都无法加载视频,这让我相信通过 CEFSharp 显示流媒体存在问题?
这是代码:
...
xmlns:cef="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
...
<cef:ChromiumWebBrowser
Width="480"
Height="270"
HorizontalAlignment="Left"
Margin="0,20,0,0"
Address="https://www.twitch.tv/shroud"
/>
<cef:ChromiumWebBrowser
Width="480"
Height="270"
HorizontalAlignment="Left"
Margin="0,20,0,0"
Address="https://www.youtube.com/embed/Xz5Nw0EY5ng"
/>
<cef:ChromiumWebBrowser
Width="480"
Height="270"
HorizontalAlignment="Left"
Margin="0,20,0,0"
Address="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2FNitroLukeDX%2Fvideos%2F710121262901568%2F&show_text=0&width=560" />
结果如下:
如有任何帮助,我们将不胜感激!
啊哈,最后有人向我指出了 ms.
的新 WebView2 控件
这会播放流媒体视频 :D
<wv2:WebView2 Name="webView"
HorizontalAlignment="Left"
Height="270"
Width="480"
Margin="0,20,0,0"
Source="https://player.twitch.tv/channel=loltyler1"/>
我正在开发 WPF 应用程序并尝试嵌入 twitch/youtube/facebook 游戏流。总的来说,我对 WPF 应用程序比较陌生。
我已使用 Twitch 嵌入代码按照 Twitch Embed API Page, and attempted to insert it into a CEFSharp window 中列出的步骤进行操作。然而,截至 2020 年,twitch 现在需要一个“父”字段来嵌入他们的视频,所以我只是尝试将实际的 twitch 页面插入 CEFsharp 元素,但它仍然给我一个错误。
对于 Facebook 和 Youtube,我也可以让嵌入的帧显示出来,但它们都无法加载视频,这让我相信通过 CEFSharp 显示流媒体存在问题?
这是代码:
...
xmlns:cef="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
...
<cef:ChromiumWebBrowser
Width="480"
Height="270"
HorizontalAlignment="Left"
Margin="0,20,0,0"
Address="https://www.twitch.tv/shroud"
/>
<cef:ChromiumWebBrowser
Width="480"
Height="270"
HorizontalAlignment="Left"
Margin="0,20,0,0"
Address="https://www.youtube.com/embed/Xz5Nw0EY5ng"
/>
<cef:ChromiumWebBrowser
Width="480"
Height="270"
HorizontalAlignment="Left"
Margin="0,20,0,0"
Address="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2FNitroLukeDX%2Fvideos%2F710121262901568%2F&show_text=0&width=560" />
结果如下:
如有任何帮助,我们将不胜感激!
啊哈,最后有人向我指出了 ms.
的新 WebView2 控件这会播放流媒体视频 :D
<wv2:WebView2 Name="webView"
HorizontalAlignment="Left"
Height="270"
Width="480"
Margin="0,20,0,0"
Source="https://player.twitch.tv/channel=loltyler1"/>