AlmarM Posted November 26, 2009 Share Posted November 26, 2009 Hi,Where I live, we have an awesome comedy show called "De Lama's". I want to make a player for the movies from a site.I can't seem to load the "file" (movie) into the flash player. There is some Java Script, Flash and .flvI'm not even sure if this is possible, but I gave it a try. Full site: Here.Here's the Javascript in the Site's sourcode:<script type="text/javascript"> var so = new SWFObject('/static/101v3/player-custom/player.swf','plyr','584','358','9'); so.addParam('allowscriptaccess','always'); so.addParam('allowfullscreen','true'); so.addVariable('plugins','/static/global/swf/jwp4-streamsense-plugin.swf'); so.addVariable('log','http://nl.sitestat.com/klo/bnn/s?bnn.101tv.video'); so.addVariable('ss_station','BNN'); so.addVariable('ss_program_title','101tv'); so.addVariable('ss_date_production',''); so.addVariable('ss_episode_title',''); so.addVariable('ss_type_stream','flv'); so.addVariable('config', '/static/101v3/player/config.xml'); so.addVariable('image', 'http://download.omroep.nl/bnn/mediadepot/video_images/4/8/8812_1.jpg'); so.addVariable('file', 'http://download.omroep.nl/bnn/mediadepot/flv/4/10/8812.flv'); so.addVariable('logo', '/static/101v3/player-logos/101.png'); so.write('videoplayer'); </script>And here's my script:Global $sPlayer = "http://www.101.tv/static/101v3/player-custom/player.swf" Global $sMovie = "http://download.omroep.nl/bnn/mediadepot/flv/4/10/8812.flv" $GUI = GUICreate("Lama's", 605, 345) $oObj = ObjCreate("ShockwaveFlash.ShockwaveFlash.1") $oPlayer = GUICtrlCreateObj($oObj, 10, 10, 585, 325) With $oObj .Movie = $sPlayer .Bgcolor = "#000000" .SetVariable('plugins','http://www.101.tv/static/global/swf/jwp4-streamsense-plugin.swf') .SetVariable('ss_station','BNN') .SetVariable('ss_program_title','101tv') .SetVariable('ss_date_production','') .SetVariable('ss_episode_title','') .SetVariable('ss_type_stream','flv') .SetVariable('config', '') .SetVariable('image', 'http://download.omroep.nl/bnn/mediadepot/video_images/4/8/8812_1.jpg') .SetVariable('file', 'http://download.omroep.nl/bnn/mediadepot/flv/4/10/8812.flv') .SetVariable('logo', 'http://www.101.tv/static/101v3/player-logos/101.png') EndWith GUISetState() While 1 Switch GUIGetMsg() Case -3 Exit EndSwitch WendHope someone knows what I mean and mayby will be able to help me. Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
bo8ster Posted November 26, 2009 Share Posted November 26, 2009 (edited) You seem to set up the object ok but you have to do something with it. For a site I use, I have embedded the movie as an object into the html (I have another script that sets it up). Its the EMBED tag that gets it to play (I think - I know RunContent is required too). Not sure how to do this in AutoIt, hope that helps. I use something like this in the HTML < <script type="text/javascript"> AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','690','height','350','src','idslideshow','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','idslideshow' ); //end AC code </SCRIPT> <NOSCRIPT> <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="690" height="350"> <PARAM name="movie" value="idslideshow.swf"> <PARAM name="quality" value="high"> <EMBED src="idslideshow.swf" QUALITY="high" PLUGINSPAGE="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" TYPE="application/x-shockwave-flash" width="649" height="323"></EMBED> </OBJECT> </NOSCRIPT> </DIV> Edited November 26, 2009 by bo8ster Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
AlmarM Posted November 27, 2009 Author Share Posted November 27, 2009 So I should create a new HTMl document with the same code, and then EMBED it? Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
czardas Posted November 27, 2009 Share Posted November 27, 2009 If you can embed the video in HTML, I don't see why you shouldn't be able to wrap a GUI around it. I tried to open the stream in VLC, but encountered some problems. Perhaps that's something to do with my computer, but seeing as you are also having problems, perhaps there is an issue with the stream? operator64Â Â ArrayWorkshop Link to comment Share on other sites More sharing options...
AlmarM Posted November 27, 2009 Author Share Posted November 27, 2009 I just started learning HTML, PHP, etc. So I nhave to idea if is corret. My try: <html> <head> <title></title> </head> <body> <script type="text/javascript"> var so = new SWFObject('http://www.101.tv/static/101v3/player-custom/player.swf','plyr','584','358','9'); so.addParam('allowscriptaccess','always'); so.addParam('allowfullscreen','true'); so.addVariable('plugins','http://www.101.tv/static/global/swf/jwp4-streamsense-plugin.swf'); so.addVariable('log','http://nl.sitestat.com/klo/bnn/s?bnn.101tv.video'); so.addVariable('ss_station','BNN'); so.addVariable('ss_program_title','101tv'); so.addVariable('ss_date_production',''); so.addVariable('ss_episode_title',''); so.addVariable('ss_type_stream','flv'); so.addVariable('config', 'http://www.101.tv/static/101v3/player/config.xml'); so.addVariable('image', 'http://download.omroep.nl/bnn/mediadepot/video_images/4/8/8812_1.jpg'); so.addVariable('file', 'http://download.omroep.nl/bnn/mediadepot/flv/4/10/8812.flv'); so.addVariable('logo', 'http://www.101.tv/static/101v3/player-logos/101.png'); so.write('videoplayer'); </script> </body> </html> Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
czardas Posted November 28, 2009 Share Posted November 28, 2009 (edited) I don't know what happened previously when I tried VLC media player, because it played the video on a second attempt. I tried some alternatives to embed the video without success. Perhaps I could find a solution given long enough, but it's not necessary. The website provides code to embed the videos when you click on the video links. Here's a sample:<html> <head> <title>Test</title> </head> <body> <embed width="420" height="290" flashvars="hash=422cbd97ddb6c4bc86fb24b672d18c21&swf_width=420&swf_height=290&website=101v2/" allowfullscreen="true" quality="high" src="http://www.bnn.nl/players/play/play.php?type=101" type="application/x-shockwave-flash"/> </body> </html>You could change the width/height. You could also create a playlist with AutoIt, either by altering the html code, or creating separate html files for each episode. I hope this helps.EDIT: Of course, if you want to watch the videos off line, you will have to download the .flv files and use another method to view them. Try VLC if you haven't already done so. Edited November 28, 2009 by czardas operator64Â Â ArrayWorkshop Link to comment Share on other sites More sharing options...
bo8ster Posted November 29, 2009 Share Posted November 29, 2009 So I should create a new HTMl document with the same code, and then EMBED it?I would say yes, I see your example but there needs to be somewhere where the 'so' (SWFObject) object is used. I believe object tags are required as 'so' is a object. I'm not a complete expert, the code given was created with Dreamweaver but I remember you set up the object then place it somewhere. You have to tell the browser where to place the object and how to use it once created. You should be able to see many examples on the net if you don't have a HTML generator.Once you have the HTML working you should be able to use _IECreateEmbedded() to run the HTML within your GUI.Here are some good links I found.http://www.flvplay.com/FLVPlay/support/customizer.htmlhttp://www.boutell.com/newfaq/creating/video.html (scroll to the end)http://www.ffmpegx.com/flv.html (scroll down) Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
Bert Posted November 30, 2009 Share Posted November 30, 2009 My Vollyviewer will handle the swf files. It doesn't work with flv files, but I use this for flv files: http://www.martijndevisser.com/blog/flv-player/ The Vollatran project  My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
skyboy Posted November 30, 2009 Share Posted November 30, 2009 (edited) it helps to know javascript and flash(actionscript, both are based on emcascript) in this case - <script type="text/javascript"> var so = new SWFObject('/static/101v3/player-custom/player.swf','plyr','584','358','9'); // this is creating a new object so.addParam('allowscriptaccess','always'); // this is setting a parameter (variable in autoit) so.addParam('allowfullscreen','true'); so.addVariable('plugins','/static/global/swf/jwp4-streamsense-plugin.swf'); // this is adding to the flashvars parameter so.addVariable('log','http://nl.sitestat.com/klo/bnn/s?bnn.101tv.video'); so.addVariable('ss_station','BNN'); so.addVariable('ss_program_title','101tv'); so.addVariable('ss_date_production',''); so.addVariable('ss_episode_title',''); so.addVariable('ss_type_stream','flv'); so.addVariable('config', '/static/101v3/player/config.xml'); so.addVariable('image', 'http://download.omroep.nl/bnn/mediadepot/video_images/4/8/8812_1.jpg'); so.addVariable('file', 'http://download.omroep.nl/bnn/mediadepot/flv/4/10/8812.flv'); so.addVariable('logo', '/static/101v3/player-logos/101.png'); so.write('videoplayer'); // this is writing the embed or object tag to the document </script> to properly emulate this, you need the following Global $sPlayer = "http://www.101.tv/static/101v3/player-custom/player.swf" Global $sMovie = "http://download.omroep.nl/bnn/mediadepot/flv/4/10/8812.flv" $GUI = GUICreate("Lama's", 605, 345) $oObj = ObjCreate("ShockwaveFlash.ShockwaveFlash.1") $oPlayer = GUICtrlCreateObj($oObj, 10, 10, 585, 325) With $oObj .Movie = $sPlayer .Bgcolor = "#000000" .SetVariable('allowfullscreen', 'true') .SetVariable('allowscriptaccess', 'never') ;~ if allowed, it could possibly open security holes. and i ;~ haven't visited the page so you may need to make your own program in C++/C# to use this properly, if they ;~ use FSCommand. if they use ExternalInterface then you NEED to use a browser, a lite version you built ;~ yourself would be best for this latter case. documentation for flash/actionscript can be found on adobe.com .SetVariable('flashvars','plugins=http://www.101.tv/static/global/swf/jwp4-streamsense-plugin.swf&log=http://nl.sitestat.com/klo/bnn/s?bnn.101tv.video&ss_station=BNN&ss_program_title=101tv&ss_type_stream=flv&config=http://www.101.tv/static/101v3/player/config.xml&image=http://download.omroep.nl/bnn/mediadepot/video_images/4/8/8812_1.jpg&file=http://download.omroep.nl/bnn/mediadepot/flv/4/10/8812.flv&logo=http://www.101.tv/static/101v3/player-logos/101.png&_url=http://www.101.tv/page/1012009/video/cdaefb880c5827d2d5fc293ef1c40350') EndWith GUISetState() While 1 Switch GUIGetMsg() Case -3 Exit EndSwitch Wend as a note - i haven't tested the code above edit: and in the flashvars, it's a url-encoded string (sorta, i don't feel like manually escaping : and /) the last parameter, _url; i added just incase they have some sort of site-lock on it, that will break it if they use _url from _root in AS2; do not know for AS3 Edited November 30, 2009 by skyboy Link to comment Share on other sites More sharing options...
czardas Posted November 30, 2009 Share Posted November 30, 2009 I think this is getting overcomplicated. Half of the javascript seems unnecessary. I'm not so sure, but perhaps it would be better placed in the head of the document. If AlmarM is just starting to learn HTML, then I think it would make more sense to leave javascript out of the equation for a while. The links provided by the website work fine for me. I would personally grab all the video links provided by the website and put them into an array. I would then create one html document and write to it using AutoIt. You could then change the video simply by refreshing the page. Put a front end on it using AutoIt _IECreateEmbedded() - as mentioned previously by bo8ster - and your done. operator64Â Â ArrayWorkshop Link to comment Share on other sites More sharing options...
skyboy Posted December 1, 2009 Share Posted December 1, 2009 in the javascript source, only two lines are unnecessary (it's used instead of a direct-embed due to microsoft screwing with things... again) and the SWFObject constructor function is not a default function, so any script without the external file (it can be linked from other sites, though it's a bad idea because you have zero control over it; and it can be embedded in the document, though it's often inadvisable to keep the actual content page small and faster to load) will fail to create the swf embed, only throw a number of errors at you in the error console of the browser. and if at all possible, use the dll for non-microsoft browsers, those tend to have more functionality and run flash faster (screwy things with microsoft's implementation that can prevent flash from running properly even with the proper version) Link to comment Share on other sites More sharing options...
Bert Posted December 1, 2009 Share Posted December 1, 2009 I've been following this with interest. Would you mind showing an example of a SWF file as well as an example of a FLV file being ran from the same directory as the script? The Vollatran project  My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
skyboy Posted December 4, 2009 Share Posted December 4, 2009 http://rapidshare.com/files/315983204/FLVPlayer.rar (714 KB) included are: autoit source, FLV player source, FLV player SWF: compressed, autoit container exe: compressed; the FLV player took me a couple hours to make, autoit i had to look some things up for using C# to get COM object names after a few hours of searching google Global $sPlayer = "/FLVPlay.swf" Global $sMovie = "http://download.omroep.nl/bnn/mediadepot/flv/4/10/8812.flv?fromExe" $GUI = GUICreate("Lama's", 800, 506) $oObj = ObjCreate("ShockwaveFlash.ShockwaveFlash.1") $oPlayer = GUICtrlCreateObj($oObj, 0, 0, 800, 506) With $oObj .Bgcolor = "#000000" .AllowFullscreen = true .AllowNetworking = "all" .AllowScriptAccess = "never" .FlashVars = "flv="&$sMovie .Movie = @ScriptDir&$sPlayer ;~ .DisableLocalSecurity() EndWith GUISetState() While 1 Switch GUIGetMsg() Case -3 Exit EndSwitch Wend the commented line should only be used on well trusted (yourself) sources something that would be useful for fullscreen apps (could be added to this to get fullscreen flash movies/games while still allowing you to control the thing [adobe disables all input methods when you use the inbuilt fullscreen]) : Global $vDLL = DllOpen("user32.dll") DllCall($vDll, "int", "SetWindowLong", "hwnd", $hWnd, "int", 0xFFFFFFF0, "int", BitAND(0x90000200, 0xFF00FF7F)) DllCall($vDll, "int", "SetWindowLong", "hwnd", $hWnd, "int", 0xFFFFFFEC, "int", 0x00040040) WinMove($winTitle, "", 0, 0, @DesktopWidth, @DesktopHeight) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now