Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Wrong path to yt.swf if using SSL

9 replies [Last post]
Reply

Hi all,

I am trying to load a playlist xspf file including links to youtube videos.

This works fine if I use an http connection. However it fails using ssl. The URL for the yt.swf is false. It is '/current_playlist/yt.swf' instead of '/static_content/yt.swf'. 'static_content' is the path with the player.swf.

Any ideas? - A specific configuration? Any ideas regarding the reason for this?

Thanks,
Daniel

Reply

Same problem here. It seems like the player uses a wrong basepath over SSL. We can't get YouTube-movies to play over https.

The player throws error #2035.

Reply

I do not believe you can play YouTube videos over https through the YouTube API.

Reply

The wrong location of the yt.swf file seems to be set due to line 84 in com.jeroenwijering.models.YoutubeModel

it contains: if(url.indexOf('http://') == 0) {

I haven't tried compiling it with e.g. an extra or clause for https. I will if I find some time. Please tell me if someone else tries first.

/** Get the location of yt.swf. **/
private function getLocation():String {
var loc:String;
var url:String = loaderInfo.url;
if(url.indexOf('http://') == 0) {
unique = Math.random().toString().substr(2);
loc = url.substr(0,url.indexOf('.swf'));
loc = loc.substr(0,loc.lastIndexOf('/')+1)+'yt.swf?unique='+unique;
} else {
unique = '1';
loc = 'yt.swf';
}
return loc;
};

Reply

Hi Daniel,

Please let me know if you compile it and it works, thanks.

Best,
-Ethan

Reply

Hi all who have looked at this thread or are searching for an answer to whether it is possible to use JW player 5 to stream a video hosted on youtube.com via HTTPS.

Daniel is correct that if you change the code snippet below in YouTubeMediaProvider.as (line 86 in revision 827) from:

/** Get the location of yt.swf. **/
private function getLocation():String {
var loc:String;
var url:String = RootReference.stage.loaderInfo.url;
if (url.indexOf('http://') == 0) {
_unique = Math.random().toString().substr(2);
loc = url.substr(0, url.indexOf('.swf'));
loc = loc.substr(0, loc.lastIndexOf('/') + 1) + 'yt.swf?unique=' + _unique;
} else {
_unique = '1';
loc = 'yt.swf';
}
return loc;
}

To:

/** Get the location of yt.swf. **/
private function getLocation():String {
var loc:String;
var url:String = RootReference.stage.loaderInfo.url;
if (url.indexOf('http://') == 0 || url.indexOf('https://') == 0) {
_unique = Math.random().toString().substr(2);
loc = url.substr(0, url.indexOf('.swf'));
loc = loc.substr(0, loc.lastIndexOf('/') + 1) + 'yt.swf?unique=' + _unique;
} else {
_unique = '1';
loc = 'yt.swf';
}
return loc;
}

And recompile the player, then the newly created player.swf file will successfully stream youtube videos when embedded in a HTTPS page. Using JW player as a proxy in this manner then allows a user to play Youtube videos in a HTTPS page without generating errors of the type:

'This page contains both secure and non-secure items. etc etc'

I have uploaded the re-compiled player to:

http://www.mediafire.com/file/mnntjtx1dcq

I would have liked to commit this code back into SVN or raise a ticket in Trac against it, but I don't have user credentials so hopefully a forum admin will pick up on this post and make the change - it would definitely be in their interests as JW player would probably be the defacto solution for streaming youtube videos from https sites.

Cheers,

Billy

Reply

is this fixed in version 5.1.897?

Reply

@Sunil -

This bug has not been fixed as of 5.1, but it will be fixed in 5.2:

http://developer.longtailvideo.com/trac/ticket/790

Reply

How do you recompile YouTubeMediaProvider.as, all i can see in my folder is:

- player-licensed.swf
- readme.html
- video.flv
- yt.swf
- swfobject.js
- preview.jpg

many thanks,
Ged

Reply

@Ged - You need to download the source from - http://developer.longtailvideo.com/trac/browser/tags/mediaplayer-5.4, there is a readme file in there with instructions on how to compile the player.

Post new comment

  • Allowed HTML tags: <code> <blockquote> <em> <strong> <strike> <ul> <li> <ol>
  • You may post code using <code>...</code> .
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options