Swap out video.js for plyr.js

This commit is contained in:
Daniel Supernault 2018-11-30 13:36:05 -07:00
parent 4a0b88a73b
commit 43afc456e8
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
8 changed files with 63 additions and 183 deletions

View file

@ -173,14 +173,30 @@ pixelfed.presenter = {
video: function(container, media) {
let wrapper = $('<div>');
wrapper.addClass('embed-responsive embed-responsive-4by3');
wrapper.addClass('');
let el = $('<video>');
el.addClass('embed-responsive-item');
el.attr('controls', '');
el.attr('loop', '');
el.attr('src', media[0]['url']);
el.attr('title', media[0]['description']);
wrapper.append(el);
container.append(wrapper);
const player = new Plyr(el, {
controls: [
'restart', // Restart playback
'play', // Play/pause playback
'progress', // The progress bar and scrubber for playback and buffering
'current-time', // The current time of playback
'duration', // The full duration of the media
'volume', // Volume control
'captions', // Toggle captions
'settings', // Settings menu
'fullscreen', // Toggle fullscreen
]
});
player.volume = 0.75;
},
imageAlbum: function(container, media, status) {