在 Windows 窗体中嵌入 flv (flash) 播放器

发布于 2024-07-04 08:27:26 字数 221 浏览 9 评论 0原文

我正在尝试在 Windows 窗体应用程序中从此处使用 flv Flash 播放器。 我目前可以毫无问题地播放 1 个 .flv 文件,但我确实需要能够播放多个文件。 有没有人有使用此控件提供的播放列表的经验,或者是否有更好的方法来做到这一点?

I'm trying to the the flv Flash player from here in a windows forms application. I currently have it playing 1 .flv file with no problems but I really need to be able to play multiple files. Has anyone had experienace of using the playlists that this control offers or is there a better way to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

和我恋爱吧 2024-07-11 08:27:29

好吧,我发现自己需要做同样的事情,并且由于没有明确的解决方案,但我想我会提供我的解决方案。 这就是我最终所做的:

//Load JWPlayer swf
axShockwaveFlash1.FlashVars = "autostart=true";
axShockwaveFlash1.ScaleMode = 0;
axShockwaveFlash1.LoadMovie(0, Directory.GetCurrentDirectory() + @"\JWPlayer\player.swf");
axShockwaveFlash1.Play();

//Play new flv
axShockwaveFlash1.CallFunction("<invoke name=\"sendEvent\" returntype=\"xml\">" + 
    "<arguments><string>load</string><string>" +
    @"C:\FLVFiles\Example.flv" +
    "</string></arguments></invoke>");

我解决这个问题的主要参考是:(查看上一篇文章)
http:// /www.longtailvideo.com/support/forums/jw-player/bug-reports/8687/how-to-call-sendevent-from-c

我提到这一点主要是因为有其他事件的链接可以称为人们可能感兴趣的。

Well I found myself needing to do the same thing and since there was no clear solution yet I figured I would provide mine. Here's what I ended up doing:

//Load JWPlayer swf
axShockwaveFlash1.FlashVars = "autostart=true";
axShockwaveFlash1.ScaleMode = 0;
axShockwaveFlash1.LoadMovie(0, Directory.GetCurrentDirectory() + @"\JWPlayer\player.swf");
axShockwaveFlash1.Play();

//Play new flv
axShockwaveFlash1.CallFunction("<invoke name=\"sendEvent\" returntype=\"xml\">" + 
    "<arguments><string>load</string><string>" +
    @"C:\FLVFiles\Example.flv" +
    "</string></arguments></invoke>");

My primary reference for figuring this out was: (Look at last post)
http://www.longtailvideo.com/support/forums/jw-player/bug-reports/8687/how-to-call-sendevent-from-c

I mention this primarily because there are links to other events that can be called which people might be interested in.

可是我不能没有你 2024-07-11 08:27:28

嗯,我也遇到了同样的问题。 问题是 loadmovie 方法似乎没有清除最后一部电影。 到目前为止,我还没有找到任何将新电影加载到同一个 Flash 播放器中的技术。

Hmm I ran into this same problem as well. The prob is that loadmovie method doesnt seem to clear the last movie. And so far I haven't found any technique to load a new movie into the same flash player.

荭秂 2024-07-11 08:27:27

您能否让控件在网页/浏览器中按照您希望的方式运行? 如果是的话(问题出在winforms上,我只是将它嵌入到浏览器控件中。如果不是,我会直接作为创建者。

Can you get the control to run the way you want it in a webpage/browser? If yes (and the problem is with winforms, I'd just embed it in a browser control. If no, I'd as the creators directly.

极致的悲 2024-07-11 08:27:27

我会非常犹豫是否将 WebBrowser 控件放置在您的软件和 flv 之间,因为您将失去对 flv 的所有控制,并且不会收到有关其状态的任何有意义的通知。 缺乏紧密的集成将导致非常差的用户体验。 博客文章此处提供了有关通过以下方式嵌入 Flash 的说明: COM。

I would be very hesitant to place the WebBrowser control between your software and the flv, because you will lose all control of the flv and will not get any meaningful notifications about its status. The lack of tight integration will lead to a very poor user experience. The blog post here has instructions on embedding flash via COM.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文