@content-blocks/js 0.7.6 → 0.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/content-accordion_11.cjs.entry.js +26 -29
- package/dist/cjs/content-accordion_11.cjs.entry.js.map +1 -1
- package/dist/cjs/content-blocks.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/elements/content-video/content-video.js +47 -24
- package/dist/collection/elements/content-video/content-video.js.map +1 -1
- package/dist/components/content-video.js +27 -29
- package/dist/components/content-video.js.map +1 -1
- package/dist/content-blocks/content-blocks.esm.js +1 -1
- package/dist/content-blocks/content-blocks.esm.js.map +1 -1
- package/dist/content-blocks/{p-8deb755c.entry.js → p-398760b3.entry.js} +2 -2
- package/dist/content-blocks/p-398760b3.entry.js.map +1 -0
- package/dist/esm/content-accordion_11.entry.js +26 -29
- package/dist/esm/content-accordion_11.entry.js.map +1 -1
- package/dist/esm/content-blocks.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components.d.ts +10 -0
- package/dist/types/elements/content-video/content-video.d.ts +6 -0
- package/package.json +2 -2
- package/dist/content-blocks/p-8deb755c.entry.js.map +0 -1
|
@@ -70292,6 +70292,7 @@ const ContentVideo = class {
|
|
|
70292
70292
|
registerInstance(this, hostRef);
|
|
70293
70293
|
this.method = 'youtube';
|
|
70294
70294
|
this.autoplay = false;
|
|
70295
|
+
this.autoplayMute = true;
|
|
70295
70296
|
this.src = '';
|
|
70296
70297
|
this.width = 16;
|
|
70297
70298
|
this.height = 9;
|
|
@@ -70311,7 +70312,7 @@ const ContentVideo = class {
|
|
|
70311
70312
|
videoConfig = {
|
|
70312
70313
|
fill: getCurrentValue(this.fitContainer) === 'true',
|
|
70313
70314
|
fluid: getCurrentValue(this.fitContainer) === 'false',
|
|
70314
|
-
autoplay: this.autoplay === true ? 'muted' : false,
|
|
70315
|
+
autoplay: this.autoplay === true ? (this.autoplayMute ? 'muted' : 'any') : false,
|
|
70315
70316
|
techOrder: ['youtube'],
|
|
70316
70317
|
src: this.src,
|
|
70317
70318
|
sources: [
|
|
@@ -70326,6 +70327,7 @@ const ContentVideo = class {
|
|
|
70326
70327
|
modestbranding: 1,
|
|
70327
70328
|
},
|
|
70328
70329
|
};
|
|
70330
|
+
console.log(videoConfig);
|
|
70329
70331
|
return videoConfig;
|
|
70330
70332
|
}
|
|
70331
70333
|
initVideo() {
|
|
@@ -70335,33 +70337,28 @@ const ContentVideo = class {
|
|
|
70335
70337
|
WindowResizeService.registerProp(this.classes).subscribe(newValue => (this.classString = newValue));
|
|
70336
70338
|
}
|
|
70337
70339
|
componentDidLoad() {
|
|
70338
|
-
|
|
70339
|
-
|
|
70340
|
-
|
|
70341
|
-
|
|
70342
|
-
|
|
70343
|
-
|
|
70344
|
-
|
|
70345
|
-
|
|
70346
|
-
|
|
70347
|
-
|
|
70348
|
-
|
|
70349
|
-
|
|
70350
|
-
|
|
70351
|
-
|
|
70352
|
-
|
|
70353
|
-
|
|
70354
|
-
|
|
70355
|
-
|
|
70356
|
-
|
|
70357
|
-
|
|
70358
|
-
|
|
70359
|
-
|
|
70360
|
-
// }
|
|
70361
|
-
}
|
|
70362
|
-
});
|
|
70363
|
-
}, options);
|
|
70364
|
-
observer.observe(this.hostElement);
|
|
70340
|
+
this.player = videojs(this.videoElement);
|
|
70341
|
+
// let observer = new IntersectionObserver(entries => {
|
|
70342
|
+
// entries.forEach(async entry => {
|
|
70343
|
+
// if (entry.isIntersecting && !this.player) {
|
|
70344
|
+
// // if (!videojs) {
|
|
70345
|
+
// // videojs = await import('video.js');
|
|
70346
|
+
// // await import('videojs-youtube/dist/Youtube.js');
|
|
70347
|
+
// // }
|
|
70348
|
+
// // this.hasPoster = !!this.hostElement.querySelector('[slot="poster"]');
|
|
70349
|
+
// // if (this.videoElement && !this.player) {
|
|
70350
|
+
// // this.player = videojs.default(this.videoElement, this.computedVideoConfig(), function onPlayerReady() {
|
|
70351
|
+
// // self.initVideo();
|
|
70352
|
+
// // if (self.hasPoster || self.autoplay) {
|
|
70353
|
+
// // self.isPlayed = true;
|
|
70354
|
+
// // setTimeout(() => this.play(), 1);
|
|
70355
|
+
// // }
|
|
70356
|
+
// // });
|
|
70357
|
+
// // }
|
|
70358
|
+
// }
|
|
70359
|
+
// });
|
|
70360
|
+
// }, options);
|
|
70361
|
+
// observer.observe(this.hostElement);
|
|
70365
70362
|
}
|
|
70366
70363
|
onClickHandler(event) {
|
|
70367
70364
|
event.preventDefault();
|
|
@@ -70377,7 +70374,7 @@ const ContentVideo = class {
|
|
|
70377
70374
|
}
|
|
70378
70375
|
render() {
|
|
70379
70376
|
let showPlayButton = !this.autoplay && ((this.hasPoster && !this.isPlayed) || !this.isPlayed);
|
|
70380
|
-
return (h(Host, { key: '
|
|
70377
|
+
return (h(Host, { key: '22cffbd35601f37a8bbc0bd5eda02cda1688c9cc', class: this.classString }, this.hasPoster && !this.isLoaded && (h("div", { key: 'a49d09ea914a8fc90c3dc10bab99e74347fad000', class: "content-video__poster" }, h("slot", { key: 'b1e57d86ac11a2b03950bb9ffb40f73253ac838b', name: "poster" }))), showPlayButton && (h("button", { key: '14dbd5508a52b66ab112d2dbfd1d5de3b96310eb', class: "content-video__play", "aria-label": this.playButtonAriaLabel, onClick: ev => this.onClickHandler(ev) }, h("slot", { key: '6ae7662d21f79e8c05c5d17652cbb7e37533cb5d', name: "playButton" }))), h("div", { key: '3b942a282fd0df1e22569fd02ff248065f67374e', class: "content-video__content" }, (!this.hasPoster || this.isLoaded) && (h("video", { key: 'd93067f22489d1afcfefcd7413e81c41e37d0c37', ref: element => (this.videoElement = element), class: "video-js vjs-content-block-theme", controls: this.controls, preload: this.preload, width: this.width, height: this.height, crossorigin: "anonymous", "data-setup": JSON.stringify(this.computedVideoConfig()) }, h("slot", { key: '8c784e20d7938cfb890d2877d208bbf514735ad4', name: "no-js-message" }), h("slot", { key: '351930777416a2bbc6a89a37e2e69f241a3dbf9c', name: "content" }), h("slot", { key: 'f06a2361d6397fca3d15a9a5533e94667a73bf15' }))))));
|
|
70381
70378
|
}
|
|
70382
70379
|
get hostElement() { return getElement(this); }
|
|
70383
70380
|
};
|