
Add YouTube URL to Playlist Using load() in JW 7
I have code that uses load() to replace the "active" video in a player with a single file reference. When I try this using a URL to a YouTube video, I get the "Error: No suitable provider found." I'm using a cloud copy of JWPlayer 7. (http://content.jwplatform.com/libraries/xxxxx.js)
Since I'm really not using a playlist, destroying and re-initializing a new player each time might be a suitable workaround, but it seems like this should work.
the following works when I supply it a full path to an MP4, but not a YouTube video.
$(document).ready(function() {
$('a.openVideo').click(function(e) {
e.preventDefault();
var videoURL = $(this).attr('href');
loadVideo(videoURL);
});
});
function loadVideo(videoURL) {
videoPlayer.load([{
file: videoURL
}]);
videoPlayer.play();
};