Archived
39 lines
1.3 KiB
HTML
39 lines
1.3 KiB
HTML
{% load staticfiles %}
|
|
{% if now_playing %}
|
|
{% if now_playing.video %}
|
|
<script type="text/javascript">
|
|
function other_video_playing() {
|
|
var now_playing_pattern = /{{ now_playing.video.videoId }}/;
|
|
|
|
return ! now_playing_pattern.test( ytplayer.getVideoUrl() );
|
|
}
|
|
|
|
function play() {
|
|
if(ytplayer) {
|
|
// start the video (if we have'nt allready)
|
|
if( other_video_playing() ) {
|
|
// show the player
|
|
$("#player").show();
|
|
ytplayer.loadVideoById("{{ now_playing.video.videoId }}", {{ now_playing.video.start }}, "hd720");
|
|
}
|
|
}
|
|
}
|
|
play();
|
|
</script>
|
|
{% else %}
|
|
<script type="text/javascript">
|
|
$("#player").delay(1000).hide();
|
|
</script>
|
|
{% if now_playing.image %}
|
|
<img src="{{ now_playing.image}}" class="now_playing" /><br />
|
|
{% endif %}
|
|
{% endif %}
|
|
<img src="{% static 'spectrum-analyzer.gif' %}" /> {{ now_playing.artist}} - {{ now_playing.title }} ♪♫<br />
|
|
{% else %}
|
|
<script type="text/javascript">
|
|
$("#player").delay(1000).hide();
|
|
</script>
|
|
<img src="{% static 'no_music_makes_me_sick_by_sakgaa.jpg' %}" /><br />
|
|
:[
|
|
{% endif %}
|