47 lines
1.0 KiB
JavaScript
47 lines
1.0 KiB
JavaScript
|
// @see https://hexdocs.pm/phoenix_live_view/js-interop.html#client-hooks-via-phx-hook
|
||
|
|
||
|
const VideojsHook = {
|
||
|
|
||
|
mounted() {
|
||
|
// var options = {};
|
||
|
// // console.log('mounted() hook. looking for #video-player')
|
||
|
|
||
|
// var player = videojs('player', options, function onPlayerReady() {
|
||
|
// // videojs.log('Your player is ready! (this is videojs_hook.js mounted() hook btw)');
|
||
|
|
||
|
|
||
|
// // How about an event listener?
|
||
|
// this.on('ended', function() {
|
||
|
// videojs.log('Awww...over so soon?!');
|
||
|
// });
|
||
|
|
||
|
|
||
|
// });
|
||
|
|
||
|
// // player.hlsQualitySelector({ displayCurrentQuality: true })
|
||
|
// // player.qualityLevels()
|
||
|
|
||
|
// player.src({
|
||
|
// src: 'https://fp-dev.b-cdn.net/package/cea2db20-1d89-4f8b-855f-d1c2e6ae2302/test2/master.m3u8',
|
||
|
// type: 'application/x-mpegURL',
|
||
|
// withCredentials: false
|
||
|
// });
|
||
|
|
||
|
|
||
|
},
|
||
|
|
||
|
|
||
|
beforeUpdate() {},
|
||
|
|
||
|
updated() {
|
||
|
console.log("VideojsHook updated");
|
||
|
},
|
||
|
|
||
|
destroyed() {},
|
||
|
|
||
|
disconnected() {},
|
||
|
|
||
|
reconnected() {}
|
||
|
}
|
||
|
|
||
|
export default VideojsHook
|