Webmaster Forum


Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Share |
  #1 (permalink)  
Old 11-23-2011, 08:31 AM
Junior Member
 
Join Date: 11-17-11
Posts: 6
iTrader: 0 / 0%
Multiple video on one page? Can't figure out id.?

I'm trying to create multiple videos on one page. I tried to give each one an individual id but failed miserably. Also how on earth do I assign a image to each player. My example works with one player only and falls back to HTML5 video with no problems . If I decided on five videos per page, how do I apply an id to each one as well as a different image per player. Here is what I have so far:

Code:
<script type="text/javascript" src="video/swfobject.js"></script> <script type="text/javascript"> var flashvars = {}; flashvars.src = "http://www.mysite.com.mp4"; flashvars.controlBarMode = "floating"; flashvars.poster = "http://mysite.com/imageonplayer.png"; var params = {}; params.allowfullscreen = "true"; params.allowscriptaccess = "always"; var attributes = {}; attributes.id = "videoDiv"; attributes.name = "myDynamicContent"; swfobject.embedSWF("http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf", "videoDiv", "487", "275", "10.1.0","expressInstall.swf", flashvars, params, attributes); </script> </head>
Code:
<div id="videoDiv"> <video controls="controls" poster="http://mysite.com/imageonplayer.png" width="487" height="275"> <source src="http://www.mysite.com/mymovie.mp4" type="video/mp4" /> <source src="http://www.mysite.com/mymovie.ogg" type="video/ogg" /> </video> </div>
I tried this but again it didn't work for me:
Code:
<script type="text/javascript"> swfobject.registerObject("videoDiv1", "10.1.0"); swfobject.registerObject("videoDiv2", "10.1.0"); swfobject.registerObject("videoDiv3", "10.1.0"); swfobject.registerObject("videoDiv4", "10.1.0"); </script>
Any suggestions?
Thanks
Dan
 
Reply With Quote
  #2 (permalink)  
Old 11-24-2011, 11:43 PM
JohnnyS's Avatar
Contributing Member
 
Join Date: 07-05-11
Location: philippines
Posts: 312
iTrader: 0 / 0%
you need to create multiple instances of your divs first..

HTML Code:
<div id="videoDiv"> <video controls="controls" poster="http://mysite.com/imageonplayer.png" width="487" height="275"> <source src="http://www.mysite.com/mymovie.mp4" type="video/mp4" /> <source src="http://www.mysite.com/mymovie.ogg" type="video/ogg" /> </video> </div> <div id="videoDiv1"> <video controls="controls" poster="http://mysite.com/imageonplayer.png" width="487" height="275"> <source src="http://www.mysite.com/mymovie.mp4" type="video/mp4" /> <source src="http://www.mysite.com/mymovie.ogg" type="video/ogg" /> </video> </div> <div id="videoDiv2"> <video controls="controls" poster="http://mysite.com/imageonplayer.png" width="487" height="275"> <source src="http://www.mysite.com/mymovie.mp4" type="video/mp4" /> <source src="http://www.mysite.com/mymovie.ogg" type="video/ogg" /> </video> </div> <div id="videoDiv3"> <video controls="controls" poster="http://mysite.com/imageonplayer.png" width="487" height="275"> <source src="http://www.mysite.com/mymovie.mp4" type="video/mp4" /> <source src="http://www.mysite.com/mymovie.ogg" type="video/ogg" /> </video> </div> <div id="videoDiv4"> <video controls="controls" poster="http://mysite.com/imageonplayer.png" width="487" height="275"> <source src="http://www.mysite.com/mymovie.mp4" type="video/mp4" /> <source src="http://www.mysite.com/mymovie.ogg" type="video/ogg" /> </video> </div>
 
Reply With Quote
  #3 (permalink)  
Old 11-25-2011, 12:23 AM
Junior Member
 
Join Date: 11-17-11
Posts: 6
iTrader: 0 / 0%
Hey Johnny, thanks for taking the time to help me out. I actually tried that but it didn't work out. For the life of, I couldn't figure out why?

Forgot to mention that in IE only the first video shows and the others don't show up at all

Last edited by dantra; 11-25-2011 at 12:34 AM.
 
Reply With Quote
  #4 (permalink)  
Old 11-29-2011, 12:41 AM
JohnnyS's Avatar
Contributing Member
 
Join Date: 07-05-11
Location: philippines
Posts: 312
iTrader: 0 / 0%
instead of using swfobject.registerObject();

you might wanna call swfobject.embedSWF multiple times with different parameters..

Code:
swfobject.embedSWF("http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf", "videoDiv", "487", "275", "10.1.0","expressInstall.swf", flashvars, params, attributes); swfobject.embedSWF("http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf", "videoDiv1", "487", "275", "10.1.0","expressInstall.swf", flashvars, params, attributes); swfobject.embedSWF("http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf", "videoDiv2", "487", "275", "10.1.0","expressInstall.swf", flashvars, params, attributes); swfobject.embedSWF("http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf", "videoDiv3", "487", "275", "10.1.0","expressInstall.swf", flashvars, params, attributes); swfobject.embedSWF("http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf", "videoDiv4", "487", "275", "10.1.0","expressInstall.swf", flashvars, params, attributes);
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Do multiple links from one page to another page count? HTMLBasicTutor Google Forum 10 09-09-2011 02:12 AM
Make Your Video Autoblog with Multiple Source Income for Free edwinhere Free Web Services 0 09-02-2011 03:32 AM
Scene Capture from a video ? I cant figure it out Linda in NY Tech Talk 3 08-07-2007 02:44 PM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 03:12 AM.
Powered by vBulletin
Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.