Embedding flv (flash) player in windows forms

青春壹個敷衍的年華 提交于 2019-11-26 21:30:40

问题


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?


回答1:


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.




回答2:


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.




回答3:


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.




回答4:


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.



来源:https://stackoverflow.com/questions/43533/embedding-flv-flash-player-in-windows-forms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!