![]() |
Make Your Own PHP Flash Player Which You Can Pass a File Variable with Preview!!!!
This idea was based on the player that can be found here
jw_flv_player I have been trying to find a way with php to automatically to add a preview image to a flv file and after an exhaustive search I have found it. If you know this already, my apologies. A lot of the credit has to go here though. http://www.ioncannon.net/php/110/usi...y-annotations/ From there I got the basic code. I have addded my logo, Mr Rant, to the lower left hand corner. ![]() I also want to be able to pass a file to the player, that I can do. I also am trying to come up with a way to make a way for it to take an xml file and create a playlist. This is the PHP that I ended up with after some modification: Code:
function createImage($img) {You will have a file named videostream1.swf saved there. Now create the html code. You need to make both the data and value parameters equal to the videostream1.swf now for the file you can pass any flv just by adding the ?file=putwhatevervideohere.flv. Code:
<div>HTML Code:
<object type="application/x-shockwave-flash" data="http://www.rantnow.net/videostream1.swf?file=http://www.rantnow.net/videos/Bikinis-Workouts.flv" width="300" height="300" id="go"></p> |
The key for your logo to show is to in function createLogo to use setDepth right after you add it.
$item=$movie->add($button); $item->setDepth(50); then you can play with the x and y cordinates to place it where you want. I would imagine a transparent png would work better, and I will play with that to see. Just want to post an update on my progress. The neat thing about adding it as a button makes the movie play when you click the logo! |
Return to an Old friend Javascript
OK, after banging my head on this for a while, I decided to go with Javascript. This is what I did created another player but this time I removed the
vStream.seek(1);//this is how we generate our preview image without a jpg image vStream.pause(); from it and I changed the name to $movie->save("videostream2.swf"); You should have two players, mine are videostream3,one in which the video is paused, and videostream6 in which when the user clicks on a div area it will write using Javascript and the innerHTML function the new player where our original player was. Code:
function divClick(filename){Now we set everything up using HTML Code:
<div class="player">Code:
#preview{Here's a pic ![]() Or you can see the working one. |
| All times are GMT. The time now is 02:29 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0