This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.$vidContainer.setAttribute('controls', 'true') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.$vidContainer.addEventListener('ended', () => { | |
VideoPlayerController.showImage(this.$imgContainer) | |
// Hand back control to this class | |
this.userControls = false | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static showImage($img) { | |
$img.classList.remove('video-container__image--hidden') | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
playVideo() { | |
console.log('HLS – Playing video') | |
VideoPlayerController.hideImage(this.$imgContainer) | |
this.$vidContainer.play().then(() => { | |
console.log('HLS - Video played') | |
}) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parseHlsManifest() { | |
console.log('HLS – Parsing video manifest') | |
const { Hls } = window | |
const hls = new Hls() | |
const { src } = this.$vidContainer | |
hls.loadSource(src) | |
hls.attachMedia(this.$vidContainer) | |
hls.on(Hls.Events.MANIFEST_PARSED, () => { | |
this.parsed = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path') | |
module.exports = { | |
// outputDir: path.resolve(__dirname, 'dist-demo'), | |
chainWebpack: config => { | |
// config | |
// .entry('app') | |
// .clear() | |
// .add('./demo/main.js') | |
config.resolve.alias |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path') | |
module.exports = { | |
// outputDir: path.resolve(__dirname, 'dist-demo'), | |
chainWebpack: config => { | |
config | |
.entry('app') | |
.clear() | |
.add('./demo/main.js') | |
// config.resolve.alias |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path') | |
module.exports = { | |
outputDir: path.resolve(__dirname, 'dist-demo'), | |
// chainWebpack: config => { | |
// config | |
// .entry('app') | |
// .clear() | |
// .add('./demo/main.js') | |
// config.resolve.alias |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// vue.config.js | |
const path = require('path') | |
module.exports = { | |
outputDir: path.resolve(__dirname, 'dist-demo'), | |
chainWebpack: config => { | |
config | |
.entry('app') | |
.clear() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.video-container__image { | |
pointer-events: none; | |
transition: opacity 0.3s cubic-bezier(0, 0.1, 0.3, 1); | |
// Add play icon | |
&::after { | |
background-image: url('/images/icon_play_big.svg'); | |
background-position: center; | |
// Play icon in large containers should be larger than in small ones | |
background-size: calc(45px + 5%); |
NewerOlder