Fix player parameters
This commit is contained in:
parent
d25146d22f
commit
d75d34abdd
|
@ -129,45 +129,45 @@ var player = videojs('player', options, function() {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.share(shareOptions);
|
||||
|
||||
<% if video_start > 0 || video_end > 0 %>
|
||||
this.markers({
|
||||
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 %>
|
||||
]
|
||||
});
|
||||
|
||||
this.currentTime(<%= video_start %>);
|
||||
<% end %>
|
||||
|
||||
<% if !listen %>
|
||||
var currentSources = player.currentSources();
|
||||
for ( var i = 0; i < currentSources.length; i++ ) {
|
||||
if (player.canPlayType(currentSources[i]['type'].split(';')[0]) === '') {
|
||||
currentSources.splice(i);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
player.src(currentSources);
|
||||
<% end %>
|
||||
});
|
||||
|
||||
player.share(shareOptions);
|
||||
|
||||
<% if video_start > 0 || video_end > 0 %>
|
||||
player.markers({
|
||||
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 %>);
|
||||
<% end %>
|
||||
|
||||
<% if !listen %>
|
||||
var currentSources = player.currentSources();
|
||||
for ( var i = 0; i < currentSources.length; i++ ) {
|
||||
if (player.canPlayType(currentSources[i]['type'].split(';')[0]) === '') {
|
||||
currentSources.splice(i);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
player.src(currentSources);
|
||||
<% end %>
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
|
|
@ -138,51 +138,51 @@ var player = videojs('player', options, function() {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.share(shareOptions);
|
||||
|
||||
<% if video_start > 0 || video_end > 0 %>
|
||||
this.markers({
|
||||
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 %>
|
||||
]
|
||||
});
|
||||
|
||||
this.currentTime(<%= video_start %>);
|
||||
<% end %>
|
||||
|
||||
<% if !listen %>
|
||||
var currentSources = player.currentSources();
|
||||
for ( var i = 0; i < currentSources.length; i++ ) {
|
||||
if (player.canPlayType(currentSources[i]['type'].split(';')[0]) === '') {
|
||||
currentSources.splice(i);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
player.src(currentSources);
|
||||
<% end %>
|
||||
|
||||
<% if preferences %>
|
||||
this.volume(<%= preferences.volume.to_f / 100 %>);
|
||||
this.playbackRate(<%= preferences.speed %>);
|
||||
<% end %>
|
||||
});
|
||||
|
||||
player.share(shareOptions);
|
||||
|
||||
<% if video_start > 0 || video_end > 0 %>
|
||||
player.markers({
|
||||
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 %>);
|
||||
<% end %>
|
||||
|
||||
<% if !listen %>
|
||||
var currentSources = player.currentSources();
|
||||
for ( var i = 0; i < currentSources.length; i++ ) {
|
||||
if (player.canPlayType(currentSources[i]['type'].split(';')[0]) === '') {
|
||||
currentSources.splice(i);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
player.src(currentSources);
|
||||
<% end %>
|
||||
|
||||
<% if preferences %>
|
||||
player.volume(<%= preferences.volume.to_f / 100 %>);
|
||||
player.playbackRate(<%= preferences.speed %>);
|
||||
<% end %>
|
||||
|
||||
function toggle(target) {
|
||||
body = target.parentNode.parentNode.children[1];
|
||||
if (body.style.display === null || body.style.display === '') {
|
||||
|
|
Loading…
Reference in a new issue