It is possible to make a flash player to obtain a link from a php file and then to stream it? If it will be mp3, to stream mp3, else to stream video avi.
By obtain the link do you mean the path to the file? Sure, easily done- check out this tutorial: http://www.oman3d.com/tutorials/flash/loadvars_bc/ You would just use load("http://domain.com/linkscript.php"); (Send variables through GET if you need to send any)
Hi, I can build a custom player that checks if the file is an mp3 or flv and streams it accordingly, you get the design you want that suits your site. Contact me via pm if you are interested. Regards.
it's possible to use GET in flash ? For example, if it's video.swf in a page called video.php?page=200, it's possible to use $_GET['page'] and then to open an external php file, located in the same folder called stream_link.php?page=the obtained page ? stream_link.php will work like this, will search in the database if there is any video, where id will be 200, and then will return a link, the returned link to be opened by the video.swf and streamed. How to do this, if possible?
Well you half lost me here lol, but how about this: You have video.php which takes a GET variable, you navigate to video.php?page=200. Your php script echo's the html to embed your swf, something like this: <EMBED src="videoplayer.swf" FlashVars="page=<? echo $_GET['page']; ?>></EMBED> Now there is a variable in your swf called 'page' that is set to the value in video.php. Then you can use flash's loadVars() function to load the link: myData.load("stream_link.php?page=" + page); The stream_link.php then searchs through your database for the correct 'page' and echo's the path to the file, like: video_path=http://mysite.com/uploads/video_h45j4h.flv Now you have a variable in your swf called video_path that is the real path to the video, then you load your flv like normal. Sorry if this is waaay off the mark lol, but that's how I understood what you were asking. If you need code just give the word =]
thanks mate, you got the ideea. One more thing, if I'll use myData.load("stream_link.php?page=" + page); and will get http://mysite.com/uploads/video_h45j4h.avi , the avi movie could be streamed, or a http://mysite.com/uploads/video_h45j4h.swf ?
Flash, I don't think, has the natural capabilities to stream an avi file, so I would suggest converting your movies to FLV/SWF, but if you don't want the quality loss then I found a tutorial on streaming audio and video- http://klaus.geekserver.net/flash/streaming.html Hope that helps =]