Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Embedded 3 consecutive videos but only first one loads
Old 10-25-2008, 05:05 PM Embedded 3 consecutive videos but only first one loads
Skilled Talker

Posts: 52
Name: Delon
Trades: 0
Hi...

I've embedded 3 consecutive videos to my website that are all pulling from this script:

<script type="text/javascript" src="swfobject.js"></script>

I've uploaded the page to my website, but the problem I'm having with browsers (except Firefox) is that only the first video loads...

Anybody have a solution for this? Thanks.
oceankid is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-25-2008, 05:06 PM Re: Embedded 3 consecutive videos but only first one loads
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
line 37
there is a missing comma!!!!!
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-25-2008, 11:09 PM Re: Embedded 3 consecutive videos but only first one loads
Skilled Talker

Posts: 52
Name: Delon
Trades: 0
What do you mean by line 37 ... comma missing?

Anyhow, here is my code:

<h3><span class="BoldBlue">Video 1</span></h3>

<div id="media">
<div id="noUpdate">
<p>The Camtasia Studio video content presented here requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by <a href="http://www.macromedia.com/go/getflashplayer">downloading here</a>.
</p>
</div>
</div>
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject( "vid1.swf", "csSWF", "640", "498", "9.0.28", "#1a1a1a");
so.addParam( "quality", "best" );
so.addParam( "allowFullScreen", "true" );
so.addParam( "scale", "noscale" );
so.addParam( "allowScriptAccess", "always" );
so.addVariable( "autostart", "false" );
so.write("media");
// ]]>
</script>

<h3><span class="BoldBlue">Video 2</span></h3>

<div id="media">
<div id="noUpdate">
<p>The Camtasia Studio video content presented here requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by <a href="http://www.macromedia.com/go/getflashplayer">downloading here</a>.
</p>
</div>
</div>
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject( "vid2.swf", "csSWF", "640", "498", "9.0.28", "#1a1a1a");
so.addParam( "quality", "best" );
so.addParam( "allowFullScreen", "true" );
so.addParam( "scale", "noscale" );
so.addParam( "allowScriptAccess", "always" );
so.addVariable( "autostart", "false" );
so.write("media");
// ]]>
</script>

<h3><span class="BoldBlue">Video 3</span></h3>

<div id="media">
<div id="noUpdate">
<p>The Camtasia Studio video content presented here requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by <a href="http://www.macromedia.com/go/getflashplayer">downloading here</a>.
</p>
</div>
</div>
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject( "vid3.swf", "csSWF", "640", "498", "9.0.28", "#1a1a1a");
so.addParam( "quality", "best" );
so.addParam( "allowFullScreen", "true" );
so.addParam( "scale", "noscale" );
so.addParam( "allowScriptAccess", "always" );
so.addVariable( "autostart", "false" );
so.write("media");
// ]]>
</script>
oceankid is offline
Reply With Quote
View Public Profile
 
Old 10-26-2008, 04:47 AM Re: Embedded 3 consecutive videos but only first one loads
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
What do you mean by line 37 ... comma missing?
Given the amount of information to diagnose the issue that was provided in post #1. ...

... What do you, think it means?


However;
Rename the objects in the second and third blocks. Having three global objects with the same name is going to cause conflicts.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-26-2008, 12:53 PM Re: Embedded 3 consecutive videos but only first one loads
Skilled Talker

Posts: 52
Name: Delon
Trades: 0
Ok -- Chris, I know you know what you are talking about... but can you point out what I'm supposed to do?

It's not for nothing I pasted the code...

Also, this script is contained once in my header:

<script type="text/javascript" src="swfobject.js"></script>



I only need to be shown something once, and I'll be out of your way.

Thanks.
oceankid is offline
Reply With Quote
View Public Profile
 
Old 10-26-2008, 09:29 PM Re: Embedded 3 consecutive videos but only first one loads
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
instead of them all being called "so" where there is every chance they will conflict with each other.

leave the first one as "var so", name the next as "var so1" and the third and last as "var so2 "
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-26-2008, 09:49 PM Re: Embedded 3 consecutive videos but only first one loads
Skilled Talker

Posts: 52
Name: Delon
Trades: 0
Thanks for your reply Chris, but unfortunately that didn't solve the problem

I'm working on a deadline here, and this is really stressing me out... I've Googled and Googled and Googled... still couldn't figure it out...

What do you suggest?


Again, here's my code:


<head>

<!-- saved from url=(0025)http://www.techsmith.com/ -->
<title></title>
<script type="text/javascript" src="swfobject.js"></script>
<link href="styles2.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<body>

<h3><span class="BoldBlue">Video 1</span></h3>

<div id="media">
<div id="noUpdate">
<p>The Camtasia Studio video content presented here requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by <a href="http://www.macromedia.com/go/getflashplayer">downloading here</a>.
</p>
</div>
</div>
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject( "vid1.swf", "csSWF", "640", "498", "9.0.28", "#1a1a1a");
so.addParam( "quality", "best" );
so.addParam( "allowFullScreen", "true" );
so.addParam( "scale", "noscale" );
so.addParam( "allowScriptAccess", "always" );
so.addVariable( "autostart", "false" );
so.write("media");
// ]]>
</script>


<h3><span class="BoldBlue">Video 2</span></h3>

<div id="media">
<div id="noUpdate">
<p>The Camtasia Studio video content presented here requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by <a href="http://www.macromedia.com/go/getflashplayer">downloading here</a>.
</p>
</div>
</div>
<script type="text/javascript">
// <![CDATA[
var so1 = new SWFObject( "vid2.swf", "csSWF", "640", "498", "9.0.28", "#1a1a1a");
so.addParam( "quality", "best" );
so.addParam( "allowFullScreen", "true" );
so.addParam( "scale", "noscale" );
so.addParam( "allowScriptAccess", "always" );
so.addVariable( "autostart", "false" );
so.write("media");
// ]]>
</script>

<h3><span class="BoldBlue">Video 3</span></h3>

<div id="media">
<div id="noUpdate">
<p>The Camtasia Studio video content presented here requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by <a href="http://www.macromedia.com/go/getflashplayer">downloading here</a>.
</p>
</div>
</div>
<script type="text/javascript">
// <![CDATA[
var so2 = new SWFObject( "vid3.swf", "csSWF", "640", "498", "9.0.28", "#1a1a1a");
so.addParam( "quality", "best" );
so.addParam( "allowFullScreen", "true" );
so.addParam( "scale", "noscale" );
so.addParam( "allowScriptAccess", "always" );
so.addVariable( "autostart", "false" );
so.write("media");
// ]]>
</script>




Thanks for all of the help thus far... hopefully you can help me figure this out.


Last edited by oceankid; 10-26-2008 at 09:55 PM..
oceankid is offline
Reply With Quote
View Public Profile
 
Old 10-26-2008, 10:05 PM Re: Embedded 3 consecutive videos but only first one loads
Skilled Talker

Posts: 52
Name: Delon
Trades: 0
I've just tried adding "so1.addParam" and "so2.addParam" in addition to "var so1" and "var so2"... that's didn't work either
oceankid is offline
Reply With Quote
View Public Profile
 
Old 10-26-2008, 10:36 PM Re: Embedded 3 consecutive videos but only first one loads
Skilled Talker

Posts: 52
Name: Delon
Trades: 0
here's my new code... still no go:

<script type="text/javascript">
// <![CDATA[
var so = new SWFObject( "vid1.swf", "csSWF", "640", "498", "9.0.28", "#1a1a1a");
so.addParam( "quality", "best" );
so.addParam( "allowFullScreen", "true" );
so.addParam( "scale", "noscale" );
so.addParam( "allowScriptAccess", "always" );
so.addVariable( "autostart", "false" );
so.write("media");
// ]]>
</script>

<script type="text/javascript">
// <![CDATA[
var so1 = new SWFObject( "vid2.swf", "csSWF1", "640", "498", "9.0.28", "#1a1a1a");
so1.addParam( "quality", "best" );
so1.addParam( "allowFullScreen", "true" );
so1.addParam( "scale", "noscale" );
so1.addParam( "allowScriptAccess", "always" );
so1.addVariable( "autostart", "false" );
so1.write("media");
// ]]>
</script>

<script type="text/javascript">
// <![CDATA[
var so2 = new SWFObject( "vid3.swf", "csSWF2", "640", "498", "9.0.28", "#1a1a1a");
so2.addParam( "quality", "best" );
so2.addParam( "allowFullScreen", "true" );
so2.addParam( "scale", "noscale" );
so2.addParam( "allowScriptAccess", "always" );
so2.addVariable( "autostart", "false" );
so2.write("media");
// ]]>
</script>

oceankid is offline
Reply With Quote
View Public Profile
 
Old 10-27-2008, 12:23 AM Re: Embedded 3 consecutive videos but only first one loads
Skilled Talker

Posts: 52
Name: Delon
Trades: 0
OK... I figured it out.

It was a CSS problem.

Camtasia uses div ids ... which obviously can only be used once per page.

I find it quite stupid... softwares piss me off! Well, I do know css inside out, so that was pretty easy to spot once I stopped thinking it was a javascript problem.



<div id="media">
<div id="noUpdate">

<p>The Camtasia Studio video content presented here requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by <a href="http://www.macromedia.com/go/getflashplayer">downloading here</a>.
</p>
</div>
</div>
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject( "6vidtut3_82.swf", "csSWF", "640", "498", "9.0.28", "#1a1a1a");
so.addParam( "quality", "best" );
so.addParam( "allowFullScreen", "true" );
so.addParam( "scale", "noscale" );
so.addParam( "allowScriptAccess", "always" );
so.addVariable( "autostart", "false" );
so.write("media2");
// ]]>
</script>


I've colored the problem in red... that is how camtasia outputted the html page of the video, which is completely ridiculous because they are limiting people to adding 1 video per page by using div ids

The idiots should have used div class and this problem would never happen to anyone.

Anyway, thanks for your help... it wasn't a javascript problem though
oceankid is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Embedded 3 consecutive videos but only first one loads
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.32931 seconds with 12 queries