This file contains 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
// header.php | |
/** | |
* setcookie() needs to be called before the opening <html> tag | |
*/ | |
<?php | |
// Fallback if client side script fails and there is an opt out request | |
$opt_out_request = $_GET['fb-pixel-status']; | |
$wants_to_opt_out = isset($opt_out_request) && $opt_out_request === 'opt-out'; |
This file contains 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 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 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 hlsSupported() { | |
const $vid = document.createElement('video') | |
return ( | |
$vid.canPlayType('application/x-mpegURL codecs="avc1.42E01E"') || | |
$vid.canPlayType('application/vnd.apple.mpegurl') | |
) | |
} |
This file contains 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 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 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 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 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 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 |
NewerOlder