responsive-youtube-player-with-playlist
responsive-youtube-player-with-playlist copied to clipboard
Can see playlist title, but no videos
Hi there, I can see the playlist title... but there are no videos :(
Here's what I got:
HTML:
<div id="rypp-demo-3" class="RYPP r16-9" data-playlist="PLm6PQRx5kcOpWHw4Z32jl6JMPABuQPm4z">
<div class="RYPP-video">
<div class="RYPP-video-player">
<!-- Will be replaced -->
</div>
</div>
<div class="RYPP-playlist">
<header>
<h2 class="_h1 RYPP-title">Playlist title</h2>
<p class="RYPP-desc">Playlist subtitle <a href="#" target="_blank">#hashtag</a></p>
</header>
<div class="RYPP-items"></div>
</div>
</div>
JS:
$(document).ready(function() {
// la magia aquí
// This key only works for this demo on GitHub
// You must create your own at:
// https://developers.google.com/youtube/v3/getting-started
window.api_key = 'AIzaSyCrTWwXQmPscI9U8dcvHgwlw88oxPNuxZU';
// Start all players on the page with default options
// $('.RYPP').rypp('AIzaSyCrTWwXQmPscI9U8dcvHgwlw88oxPNuxZU');
// Start two players by ID, with default settings
$('#rypp-demo-1').rypp( window.api_key, { debug: true } );
$('#rypp-demo-2').rypp( window.api_key, { debug: true } );
// Start two players by ID, with default settings
$('#rypp-demo-3').rypp( api_key ,{
update_title_desc: true, // Default false
autoplay: true,
autonext: true,
loop: true,
mute: true,
debug: false
});
// 100 videos in playlist
$('#rypp-demo-4').rypp( window.api_key, { debug: true } );
});
RESULT:
Thanks for your help!
its a nice library. I was able to fix this error by changing
if ( typeof this.options.playable_region === false ||
to
if ( this.options.playable_region === false ||
and adding few lines here
that.addVideo2Playlist(vid, tit, aut, thu);
if(that.DOM.$el[0].ytplayer.getVideoUrl() == "https://www.youtube.com/watch"){
that.DOM.$el[0].ytplayer.cueVideoById({videoId:vid});
}
I had the same problem as roselleignacio. I tried to fix code as jkb016 adviced and still couldn't see videos. So I fixed code only with this change and it worked:
if ( typeof this.options.playable_region === false ||
to
if ( this.options.playable_region === false ||