![](https://secure.gravatar.com/avatar/7aaa37ae17a34102c9274e041f2fd2a1?rating=PG&size=50&default=https%3A%2F%2Fcdn.desk.com%2Fassets%2Funknown_user_50-8ad5644bbe6b1bd7454f2ea465f782bd.png)
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();
};