summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-08-05 07:38:43 -0500
committerOmar Roth <omarroth@hotmail.com>2018-08-05 07:38:43 -0500
commitd75d34abddaa6c4173c5cc67fbd3ed18283f03bc (patch)
treebc39f8a60f4b28e2d9c829bffe424755be4897c8 /src
parentd25146d22f07632eeb7058ec27c7be5a5151e2f2 (diff)
downloadinvidious-d75d34abddaa6c4173c5cc67fbd3ed18283f03bc.tar.gz
invidious-d75d34abddaa6c4173c5cc67fbd3ed18283f03bc.tar.bz2
invidious-d75d34abddaa6c4173c5cc67fbd3ed18283f03bc.zip
Fix player parameters
Diffstat (limited to 'src')
-rw-r--r--src/invidious/views/embed.ecr70
-rw-r--r--src/invidious/views/watch.ecr80
2 files changed, 75 insertions, 75 deletions
diff --git a/src/invidious/views/embed.ecr b/src/invidious/views/embed.ecr
index 7c02e9e6..ab3f18fa 100644
--- a/src/invidious/views/embed.ecr
+++ b/src/invidious/views/embed.ecr
@@ -129,45 +129,45 @@ var player = videojs('player', options, function() {
}
}
});
+});
- this.share(shareOptions);
+player.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 %>
- ]
- });
+<% 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 %>
+ ]
+});
- this.currentTime(<%= video_start %>);
- <% 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 !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>
diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr
index 85ceafb6..af6ed5e9 100644
--- a/src/invidious/views/watch.ecr
+++ b/src/invidious/views/watch.ecr
@@ -138,50 +138,50 @@ var player = videojs('player', options, function() {
}
}
});
+});
- this.share(shareOptions);
+player.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 %>
- ]
- });
+<% 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 %>
- 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--;
+ }
+}
- <% 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.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];