|
|
@ -40,7 +40,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
<div class="h-box">
|
|
|
|
<div class="h-box">
|
|
|
|
<video style="width:100%" playsinline poster="<%= thumbnail %>" title="<%= HTML.escape(video.title) %>"
|
|
|
|
<video style="width:100%" playsinline poster="<%= thumbnail %>" title="<%= HTML.escape(video.title) %>"
|
|
|
|
id="player" class="video-js" data-setup="{}"
|
|
|
|
id="player" class="video-js"
|
|
|
|
<% if autoplay %>autoplay<% end %>
|
|
|
|
<% if autoplay %>autoplay<% end %>
|
|
|
|
<% if video_loop %>loop<% end %>
|
|
|
|
<% if video_loop %>loop<% end %>
|
|
|
|
controls>
|
|
|
|
controls>
|
|
|
@ -100,7 +100,7 @@ var shareOptions = {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var player = videojs('player', options, function() {
|
|
|
|
var player = videojs('player', options, function() {
|
|
|
|
this.hotkeys({
|
|
|
|
this.hotkeys({
|
|
|
|
volumeStep: 0.1,
|
|
|
|
volumeStep: 0.1,
|
|
|
|
seekStep: 5,
|
|
|
|
seekStep: 5,
|
|
|
|
enableModifiersForNumbers: false,
|
|
|
|
enableModifiersForNumbers: false,
|
|
|
@ -138,50 +138,50 @@ var player = videojs('player', options, function() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
player.share(shareOptions);
|
|
|
|
this.share(shareOptions);
|
|
|
|
|
|
|
|
|
|
|
|
<% if preferences %>
|
|
|
|
<% if video_start > 0 || video_end > 0 %>
|
|
|
|
player.volume(<%= preferences.volume.to_f / 100 %>);
|
|
|
|
this.markers({
|
|
|
|
player.playbackRate(<%= preferences.speed %>);
|
|
|
|
onMarkerReached: function(marker) {
|
|
|
|
<% end %>
|
|
|
|
if (marker.text === 'End') {
|
|
|
|
|
|
|
|
if (player.loop()) {
|
|
|
|
|
|
|
|
player.markers.prev('Start');
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
player.pause();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
markers: [
|
|
|
|
|
|
|
|
{time: <%= video_start %>, text: 'Start'},
|
|
|
|
|
|
|
|
<% if video_end < 0 %>
|
|
|
|
|
|
|
|
{time: <%= video.info["length_seconds"].to_f - 0.5 %>, text: 'End'}
|
|
|
|
|
|
|
|
<% else %>
|
|
|
|
|
|
|
|
{time: <%= video_end %>, text: 'End'}
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
<% if video_start > 0 || video_end > 0 %>
|
|
|
|
this.currentTime(<%= video_start %>);
|
|
|
|
player.markers({
|
|
|
|
<% end %>
|
|
|
|
onMarkerReached: function(marker) {
|
|
|
|
|
|
|
|
if (marker.text === 'End') {
|
|
|
|
|
|
|
|
if (player.loop()) {
|
|
|
|
|
|
|
|
player.markers.prev('Start');
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
player.pause();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
markers: [
|
|
|
|
|
|
|
|
{time: <%= video_start %>, text: 'Start'},
|
|
|
|
|
|
|
|
<% if video_end < 0 %>
|
|
|
|
|
|
|
|
{time: <%= video.info["length_seconds"].to_f - 0.5 %>, text: 'End'}
|
|
|
|
|
|
|
|
<% else %>
|
|
|
|
|
|
|
|
{time: <%= video_end %>, text: 'End'}
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
player.currentTime(<%= video_start %>);
|
|
|
|
<% if !listen %>
|
|
|
|
<% end %>
|
|
|
|
var currentSources = player.currentSources();
|
|
|
|
|
|
|
|
for ( var i = 0; i < currentSources.length; i++ ) {
|
|
|
|
|
|
|
|
if (player.canPlayType(currentSources[i]['type'].split(';')[0]) === '') {
|
|
|
|
|
|
|
|
currentSources.splice(i);
|
|
|
|
|
|
|
|
i--;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
<% if !listen %>
|
|
|
|
player.src(currentSources);
|
|
|
|
var currentSources = player.currentSources();
|
|
|
|
<% end %>
|
|
|
|
for ( var i = 0; i < currentSources.length; i++ ) {
|
|
|
|
|
|
|
|
if (player.canPlayType(currentSources[i]['type'].split(';')[0]) === '') {
|
|
|
|
|
|
|
|
currentSources.splice(i);
|
|
|
|
|
|
|
|
i--;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
player.src(currentSources);
|
|
|
|
<% if preferences %>
|
|
|
|
<% end %>
|
|
|
|
this.volume(<%= preferences.volume.to_f / 100 %>);
|
|
|
|
|
|
|
|
this.playbackRate(<%= preferences.speed %>);
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
function toggle(target) {
|
|
|
|
function toggle(target) {
|
|
|
|
body = target.parentNode.parentNode.children[1];
|
|
|
|
body = target.parentNode.parentNode.children[1];
|
|
|
|