embed video in website

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sobha
Forum Commoner
Posts: 56
Joined: Wed Jul 15, 2009 9:08 pm

embed video in website

Post by sobha »

Hi,

Please tell me the best approach and source code to embed a avi and wmv video in my website using PHP or javascript.

Regards,
Sobha
iamngk
Forum Commoner
Posts: 50
Joined: Mon Jun 29, 2009 2:20 am

Re: embed video in website

Post by iamngk »

you have to convert .avi and .wmv video into flv format.(you can convert it through FFMpeg).
Then you can play those videoa through any flash vido player.
sobha
Forum Commoner
Posts: 56
Joined: Wed Jul 15, 2009 9:08 pm

Re: embed video in website

Post by sobha »

Thanks for your reply.I converted my files to .flv format and tried the following code .But it is not working.Please help.

Code: Select all

 
<html><head><script type="text/javascript" src="swfobject.js"></script></head><body>
    <p id="player"><a href="http://www.macromedia.com/go/getflashplayer">Get Flash</a> to see this player.</p>
    <script type="text/javascript">
    var so = new SWFObject('mediaplayer.swf','player','280','230','7');
    so.addParam("allowfullscreen","true");
    so.addVariable("file","LuanaNodaVideo.flv");
    so.addVariable("height","230");
    so.addVariable("width","280");  
    so.write('player');
</script></body>
</html> 
 
Regards,
Sobha
Attachments
swfobject.rar
(29.25 KiB) Downloaded 13 times
Last edited by Benjamin on Thu Jul 16, 2009 7:55 pm, edited 1 time in total.
Reason: Added [code=html] tags.
iamngk
Forum Commoner
Posts: 50
Joined: Mon Jun 29, 2009 2:20 am

Re: embed video in website

Post by iamngk »

is your falsh video player working good..? one more thing i noticed that your video1.html still use "LuanaNodaVideo.wmv" not "LuanaNodaVideo.flv".Also, that video file is not available in the folder.

in my system it does not show the flash player.. i tried with AC_RunActiveContent.js, please see video2.html in attachment.

i used my own video, player is comming in browser. but it is not playing the video. i hope there might be problem with your player please double check that.
Attachments
swfobject.rar
(32.31 KiB) Downloaded 13 times
sobha
Forum Commoner
Posts: 56
Joined: Wed Jul 15, 2009 9:08 pm

Re: embed video in website

Post by sobha »

Thanks for your reply.As you told player is comming in browser. but it is not playing the video.Is it due to problem in mediaplayer.swf file.Do you have any other working codes?
iamngk
Forum Commoner
Posts: 50
Joined: Mon Jun 29, 2009 2:20 am

Re: embed video in website

Post by iamngk »

yes it might be problem with mediaplayer.swf. are you sure with a input parameters to the player. are you sure "file" is parameter name? if that is correct, then problem with your player. try to use any other player(.swf) to play the video.
sobha
Forum Commoner
Posts: 56
Joined: Wed Jul 15, 2009 9:08 pm

Re: embed video in website

Post by sobha »

Hi,
Thanks for your reply.I made a slight modification in my code.Please check the video.html file in the attachment.Now this coding is working in my system .But it is not playing in the production system.Do i need to have any settings to be done in the server?

Regards,
Sobha
Attachments
video.rar
(241.58 KiB) Downloaded 7 times
iamngk
Forum Commoner
Posts: 50
Joined: Mon Jun 29, 2009 2:20 am

Re: embed video in website

Post by iamngk »

it is playing good in my system.. i hope that video.flv file might not uploaded properly in server.
check the file existence and file size in the server.
sobha
Forum Commoner
Posts: 56
Joined: Wed Jul 15, 2009 9:08 pm

Re: embed video in website

Post by sobha »

Hi,
Thanks for your reply.That file is playing properly in server also when i directly double click that video.html file.But not playing when run through http://localhost/video/video.html.
The image and player is displayed.But the video is not playing.Is it something related to IIS?
please help.

Regards,
Sobha
Post Reply