changeset 98:4de34a1446a0

Fix video page. Was only displaying 2 videos in playlist. YouTube must have changed something? In any event, it is easier to use now. Can just use an <iframe> and give it a list of videos now.
author Brian Neal <bgneal@gmail.com>
date Fri, 13 Jul 2012 21:36:53 -0500
parents c3b5b4639a15
children e4a1532b0620
files bns_website/templates/videos/index.html
diffstat 1 files changed, 4 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/bns_website/templates/videos/index.html	Thu Dec 29 14:12:13 2011 -0600
+++ b/bns_website/templates/videos/index.html	Fri Jul 13 21:36:53 2012 -0500
@@ -8,32 +8,13 @@
 {% if videos %}
 <p>
 Please enjoy this {{ videos|length }} video playlist of the bands that performed on the 
-<em>Brave New Surf</em> compilation. You can use the button that looks like a widescreen TV
+<em>Brave New Surf</em> compilation. Once you press play, you can use the playlist button
 at the bottom of the player to scroll through all the videos.
 </p>
-<div id="player"></div>
 
-<script>
-var tag = document.createElement('script');
-tag.src = "http://www.youtube.com/player_api";
-var firstScriptTag = document.getElementsByTagName('script')[0];
-firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
-
-var player;
-function onYouTubePlayerAPIReady() {
-  player = new YT.Player('player', {
-    videoId: '{{ videos|first }}',
-    {% if videos|length > 1 %}
-    playerVars: { playlist: [
-       {% for video in videos|slice:"1:" %}
-         {% if not forloop.first %},{% endif %}'{{ video }}'
-       {% endfor %} ]},
-    {% endif %}
-    width: '853',
-    height: '480'
-  });
-}
-</script>
+<iframe id="ytplayer" type="text/html" width="853" height="480"
+   src="http://www.youtube.com/embed/{{ videos|first }}?version=3&playlist={{ videos|slice:"1:"|join:"," }}"
+  frameborder="0"/>
 
 {% else %}
    <p>Videos of the bands are coming soon. Please check back later.</p>