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?
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.
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.
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.
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.
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).
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
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).
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.
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.
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.
<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?
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>
*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...*
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. :-)
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"> 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: