Files
nextcloud-docs/static/js/modules/youtubePlayer.js
John Molakvoæ (skjnldsv) 2e3fd286e0 Fix docs home page
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-11-28 22:52:51 +01:00

33 lines
700 B
JavaScript

// This use the plyr plugin, for more information use the link above
// https://github.com/sampotts/plyr
define(['jquery', 'lodash', 'plyr'],
function ($, _, plyr) {
$(document).ready(function() {
'use strict';
var YoutubePlayer = {
init: function() {
this.startPlayer();
this.getCss();
},
getCss: function() {
$('head').append('<link>');
var css = $('head').children(':last');
css.attr({
rel: 'stylesheet',
type: 'text/css',
href: 'https://cdn.plyr.io/2.0.13/plyr.css'
});
},
startPlayer: function() {
plyr.setup({
//Pass extra options here if needed
});
}
};
YoutubePlayer.init();
});
});