Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Error #2124 loading youtube playlist content


Hi All,

I'm testing the latest version of the JW FLV media player and the players playlist is successfully loading the content from a youtube playlist but when I try to play any of the videos, the player shows a Error #2124.

The test page can be viewed here: http://www.aspworldtour.com/2008/youtube_test2.asp

I'm using essentially the same code generated by the wizard:

bc.. <script type="text/javascript">
var so = new SWFObject('flvplayer2.swf','mpl','470','470','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam('flashvars','&file=http://gdata.youtube.com/feeds/api/playlists/F6308AADB2AEBE11&playlist=bottom');
so.write('player');
</script>



Can anybody help or explain what the problem might be?

Thanks in advance,
Ben

27 Community Answers

JW Player

User  
0 rated :

hey guy!

i was working out the youtube playlist today also! :D

i think i've figured out the problem and here are the solutions:

1. change the name to "player.swf" instead of "flvplayer2.swf"
or
2. link the source to http://www.jeroenwijering.com/embed/player.swf

does it work? :)

****

ps: can u tell me how to work out this box? :0 it's cool.
i mean this---> http://www.youtube.com/cp/vjVQa1PpcFMGQvv7c4pG7jokhGjEkimSPUHZBfPiWpU=

thanks! ;>

JW Player

User  
0 rated :

Thanks Rubiz,

The first option does not work but the second option does, however I would prefer not to link directly to Jeroen's player if there is a way to use the player stored locally on our server.

I'm wondering if my problem could be related to the cross domain issue.

Anyone?

Ben

JW Player

User  
0 rated :

Nearly forgot Rubiz - that box is a customised player that is created using a "Wizard" in Youtube and it automatically creates the embed code for you. All you need is a youtube account to make a custom player.

If we can't resolve the issue with JW's player, we are going to use the Youtube custom player instead.

Ben

JW Player

User  
0 rated :

Thanks Ben,

I found it's so strange that when I test your playlist with the player linked from my geocities account, it appeared error #2035 and didn't work. However, when I link the player loaded from my school sever account, it works.
Though I'm not so understand what is mean by cross domain issue, I agree with you that it's a problem related to the domain.
Sorry I can't help also but I'll keep on thinking about that.

*I just know that If the playlist is .xml fomat, it must be stored in the exact domain of the player. I host both my xml file and the player in geocities and it works well.

JW Player

User  
0 rated :

@rubiz,

You have to download Ben's playlist, then upload it to your server.

Adobe Flash Player security restrictions require that the movie (mediaplayer.swf or player.swf or imagerotator.swf) and all data files (playlist.xml, captions.xml, etc) _MUST_ come from the *_EXACT_* same domain unless you put a cross-domain policy file on the the server that is serving the data files.

Reference: *http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14213*

Therefore, you must either:

1) download the player or rotator package from: *http://code.jeroenwijering.com/trac/browser/tags*, unzip the package, and upload mediaplayer.swf or player.swf or imagerotator.swf to your server or,

2) place a cross-domain policy on the server that is hosting the data file(s).

JW Player

User  
0 rated :

@kLink,

Thanks for your reference! Now we understand the problem. :)

Here's my remark:
Coz Ben's playlist is actually the Youtube data API (http://gdata.youtube.com/feeds/api/playlists/F6308AADB2AEBE11), so, in order to solve the cross-domain problem, he has to upload the whole package of the player to his server. Is it right?

But I still got a question. Why I could successfully load Ben's playlist (Youtube data API) with the player from my school server account (I didn't upload the whole package, only swfobject.js and player.swf)? Is it related to the commercial issue? (Maybe my school server has a special "license"?) I dunno. :O

Thanks again. You gave us a BIG help!

JW Player

User  
0 rated :

@rubiz,

If you are loading a YouTube playlist directly, there is no cross-domain issue, because YouTube has a cross-domain policy file on their server (you can find it in your browser's cache).

Therefore:bc.. so.addVariable('file', 'http://gdata.youtube.com/feeds/api/playlists/F6308AADB2AEBE11');


works for everyone, everywhere.

You can test access to the YouTube playlist by copying & pasting the URI into your browser. It will return a valid playlist if it's working.

JW Player

User  
0 rated :

@kLink

Thanks.

But I'm sorry that I'm not quite sure about what you mentioned. Do you mean that if we use youtube data API as the source, we can still link the player simply from other server? So there is no need for us to download the whole package? But if it happens, error will appear, just as same as Ben's case.

Sorry I'm kind of stupid.. :x

JW Player

User  
0 rated :

And let me clarify my problem again.

here is the source, which I hope to load.
*http://gdata.youtube.com/feeds/api/playlists/F6308AADB2AEBE11
*
I just uploaded swfobject.js and player.swf to the servers below.
Server1: *http://hk.geocities.com/ru_biz/player.swf*
Server2: *http://MY-SCHOOL-SERVER.org/s051515/JW/player.swf*

Error#2035 is appeared when I load the player from Server1.
Everything works well when I load the player from Server2.

I wondered what problem it is..

JW Player

User  
0 rated :

You guys are addressing Youtube playlist files and cross domain issues... but Im getting an error #2124 and I am only trying to load a single YouTube file.

here is my code:

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

<div id="player">This text will be replaced</div>

<script type="text/javascript">
var so = new SWFObject('/embed/player.swf','mpl','470','320','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam('flashvars','&file=http://www.youtube.com/v/_dZ012oFdjs');
so.write('player');
</script>

Pretty simple huh??? I got flash 9 running...

NOTE: I got this code from the jeroenwijering wizzard, also the player and swfobject.js downloaded from this site are in the right place place (embed folder), as the code suggests. Its all running on my IIS server at home...

So where am I going wrong..? Was there something I missed?



--dw

JW Player

User  
0 rated :

@Dwayne,

You didn't mention the YouTube proxy...

Does that mean that you haven't installed it?

Get the updated YouTube proxy *(YT.SWF)* from this thread: *http://www.jeroenwijering.com/?thread=12407#msg82189* if you need it.



JW Player

User  
0 rated :

Yes I have that. I downloaded it yesterday. ....OH Wait!

You mean instead of me using player.swf, I am to use yt.swf...???

JW Player

User  
0 rated :

No, you still use player.swf, but the YouTube proxy has to be in the same directory on your server as player.swf.

JW Player

User  
0 rated :

hmm... not sure how to use this... that thread doesn't really address 1 video file. It keeps talking about playlists...

JW Player

User  
0 rated :

A single YouTube URL would be exactly the way your code is now:bc.. so.addParam('flashvars','&file=http://www.youtube.com/v/_dZ012oFdjs');

JW Player

User  
0 rated :

Ok. So why am I getting the error #2124 if nothing is supposed to change from my current code. This is what i am using and I get the error...

Is there supposed to be something else installed on the server to make this work? Does this work for you? Try it...

JW Player

User  
0 rated :

I'm getting the #2124 error as well on any youtube file using the playlist, does 4.1 need an update already, or is it a youtube issue?

JW Player

User  
0 rated :

@Dwayne & jk,

Runtime Error Message: *2124 Loaded file is an unknown type.*

You might try adding the *type* flashvar to your code.bc.. so.addParam('flashvars','*type=youtube*&file=http://www.youtube.com/v/_dZ012oFdjs');

In addition to the player.swf, you need swfobject.js, and YT.SWF (the YouTube proxy).

In this thread: *http://www.jeroenwijering.com/?thread=12407* there is some discussion about needing a new YouTube proxy. However, I'm still using the original YT.SWF and your YouTube video at: *http://www.youtube.com/v/_dZ012oFdjs* works fine for me in the v4.1.60 player _without_ using the *type* flashvar.

Also works fine in a playlist:bc.. <track>
<creator>7: Larry Sanders</creator>
<title>7: Larry Sanders</title>
<location>http://www.youtube.com/v/_dZ012oFdjs</location>
<image>http://img.youtube.com/vi/_dZ012oFdjs/0.jpg</image>
<info>http://my.domain.com/</info>
</track>

JW Player

User  
0 rated :

*As rubiz has pointed out ..nobody is unfortunately resolving the original issue. I am also getting Error#2035 when I load the player from Server. But it is playing fine in my local system. And nobody is addressing that issue...No playlists..only single file...*

JW Player

User  
0 rated :

OK here's the deal. I have 2 files.
video.html and swfobject.js in the root of my IIS Server test box.

I also have yt.swf, and player.swf.

I added the param, ( so.addParam('flashvars','type=youtube&file=http://www.youtube.com/v/_dZ012oFdjs'); )

The following code is what I had in the video.html file.

<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript" src="swfobject.js"></script>
<div id="player">This text will be replaced</div>
<script type="text/javascript">
var so = new SWFObject('player.swf','mpl','270','undefined','9');
so.addParam('flashvars','type=youtube&file=http://www.youtube.com/v/_dZ012oFdjs');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam('flashvars','&file=http://www.youtube.com/v/5q5R4sXKViU&hl=ja&fs=1&volume=100&autostart=true');
so.write('player');
</script>
</body>
</html>

Nothing seem to work until.................

I pointed the player at the JW server.


I changed: var so = new SWFObject('player.swf','mpl','270','undefined','9');

to

var so = new SWFObject('http://www.jeroenwijering.com/embed/player.swf','mpl','270','undefined','9');

This is a revelation. I tried downloading the latest player still didn't work but it still works when I point the code at JW's player on this website.

So the question is....

What is running on http://www.jeroenwijering.com's website that the rest of us poor souls don't have that makes this YouTube linked video work, where as it's not working for all of these people posting issues regarding this in this forum?????????

What does JW have on this server that I don't have on my server to make this work?
And could someone kindly show me where to put the yt.swf in my code?

Also I can not use a playlist. This will appear on a news site which means it will retrieve the YouTube link from a database using asp (VB script) which makes this quite simple, to add new articles with a relevant YouTube link. If could just get this player to work. :-)


I appreciate any help.
--dwayne

JW Player

User  
0 rated :

Hi at all,
I read the answers but I don't understand how I have to configure player.swf to see an YouTube Playlist.

@kLink : How I have to create my playlist.xml? Could you post a template of an xml file for youtube videos to edit ? thank you

I created a playlist on YouTube ( id = 35386B1041DBF178 ) but it does not work ... can you help me? thank you

JW Player

User  
0 rated :

I will implement your suggestions and keep this thread posted on my results.

JW Player

User  
0 rated :

kLink & Tommy...

After implementing kLink's suggestions I was still unable to get the player to work. So I decided to try the wizard again. Except this time after seeing it work on JW's website and not on my own I decided to follow the links posted in JW's code and find out what was being used on this site.

So I downloaded JW's YT.swf, swfObject.js and player,swf by using the following URL's:
http://www.jeroenwijering.com/embed/yt.swf
http://www.jeroenwijering.com/embed/swfobject.js
http://www.jeroenwijering.com/embed/player.swf

as posted in the code... because I was perplexed with the question "what is JW using that I am not" ...apparently updated files, because once I replaced these 3 files everything started working, with no problems. I am one to learn by example so the logical deduction is *if the code worked on JW's site it should logically work on my site*, that's why I had to try JW's files.

My code is as follows:
---------------------------------------------------------------------------------------------------
<html>
<header></header>
<body>

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

<div id="player">This text will be replaced</div>

<script type="text/javascript">
var so = new SWFObject('/embed/player.swf','mpl','470','320','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam('flashvars','&file=http://jp.youtube.com/watch?v=_dZ012oFdjs');
so.write('player');
</script>

</body>

</html>
-----------------------------------------------------------------------------------------------------------------------
No Additives or preservatives, just plain and simple code that the wizard gave me.


If you can not find the latest files being used in the wizard examples you could do the following...

The quick way is
1.Copy and paste the following lines in a text editor like notepad etc:

<a href="http://www.jeroenwijering.com/embed/yt.swf">http://www.jeroenwijering.com/embed/yt.swf</a>
<a href="http://www.jeroenwijering.com/embed/swfobject.js">http://www.jeroenwijering.com/embed/swfobject.js</a>
<a href="http://www.jeroenwijering.com/embed/player.swf">http://www.jeroenwijering.com/embed/player.swf</a>

2. Name the text file test.html, place it on your desktop

3. Double click it, and when it opens right-click on each link choosing to Save-As

Download them and use them.

I'm sure there is an easier way but for me I wanted exactly what was being used in the wizard...
My YouTube feeds work fine using JW's player now.

Thanks everyone for your help.

JW Player

User  
0 rated :

hey what are you doing in your house and bey!!!

JW Player

User  
0 rated :

oh i know so what are you doing!!!!!!!!!!!!!!!!

JW Player

User  
0 rated :

so you are in your house right!!!

JW Player

User  
0 rated :

Theproblemwithyourcodeisthatthefirstgroupofflashvarsisoverwrittenbythesecondgroupofflashvars.

Also,youcanonlyhavethefileflashvar(oranyotherflashvar)onceinthecode.bc.. <scripttype="text/javascript">
varso=newSWFObject('player.swf','mpl','270','undefined','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addVariable('type','youtube');
so.addVariable('file','http://www.youtube.com/v/_dZ012oFdjs');
so.addVariable('volume','100');
so.addVariable('autostart','true');
so.write('player');
</script>


YT.SWFjustgoesinthesamedirectoryasPLAYER.SWF.

Touseaplaylist,yousimplyreplacetheYouTubeURIwithaURIfora*[i]valid[/i]*playlist:bc.. so.addVariable('file','http://my.domain.com/path/playlist.xml');


This question has received the maximum number of answers.