@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
|
@@ -70296,6 +70296,7 @@ const ContentVideo = class {
|
|
|
70296
70296
|
index.registerInstance(this, hostRef);
|
|
70297
70297
|
this.method = 'youtube';
|
|
70298
70298
|
this.autoplay = false;
|
|
70299
|
+
this.autoplayMute = true;
|
|
70299
70300
|
this.src = '';
|
|
70300
70301
|
this.width = 16;
|
|
70301
70302
|
this.height = 9;
|
|
@@ -70315,7 +70316,7 @@ const ContentVideo = class {
|
|
|
70315
70316
|
videoConfig = {
|
|
70316
70317
|
fill: utils$1.getCurrentValue(this.fitContainer) === 'true',
|
|
70317
70318
|
fluid: utils$1.getCurrentValue(this.fitContainer) === 'false',
|
|
70318
|
-
autoplay: this.autoplay === true ? 'muted' : false,
|
|
70319
|
+
autoplay: this.autoplay === true ? (this.autoplayMute ? 'muted' : 'any') : false,
|
|
70319
70320
|
techOrder: ['youtube'],
|
|
70320
70321
|
src: this.src,
|
|
70321
70322
|
sources: [
|
|
@@ -70330,6 +70331,7 @@ const ContentVideo = class {
|
|
|
70330
70331
|
modestbranding: 1,
|
|
70331
70332
|
},
|
|
70332
70333
|
};
|
|
70334
|
+
console.log(videoConfig);
|
|
70333
70335
|
return videoConfig;
|
|
70334
70336
|
}
|
|
70335
70337
|
initVideo() {
|
|
@@ -70339,33 +70341,28 @@ const ContentVideo = class {
|
|
|
70339
70341
|
windowResizeService.WindowResizeService.registerProp(this.classes).subscribe(newValue => (this.classString = newValue));
|
|
70340
70342
|
}
|
|
70341
70343
|
componentDidLoad() {
|
|
70342
|
-
|
|
70343
|
-
|
|
70344
|
-
|
|
70345
|
-
|
|
70346
|
-
|
|
70347
|
-
|
|
70348
|
-
|
|
70349
|
-
|
|
70350
|
-
|
|
70351
|
-
|
|
70352
|
-
|
|
70353
|
-
|
|
70354
|
-
|
|
70355
|
-
|
|
70356
|
-
|
|
70357
|
-
|
|
70358
|
-
|
|
70359
|
-
|
|
70360
|
-
|
|
70361
|
-
|
|
70362
|
-
|
|
70363
|
-
|
|
70364
|
-
// }
|
|
70365
|
-
}
|
|
70366
|
-
});
|
|
70367
|
-
}, options);
|
|
70368
|
-
observer.observe(this.hostElement);
|
|
70344
|
+
this.player = videojs(this.videoElement);
|
|
70345
|
+
// let observer = new IntersectionObserver(entries => {
|
|
70346
|
+
// entries.forEach(async entry => {
|
|
70347
|
+
// if (entry.isIntersecting && !this.player) {
|
|
70348
|
+
// // if (!videojs) {
|
|
70349
|
+
// // videojs = await import('video.js');
|
|
70350
|
+
// // await import('videojs-youtube/dist/Youtube.js');
|
|
70351
|
+
// // }
|
|
70352
|
+
// // this.hasPoster = !!this.hostElement.querySelector('[slot="poster"]');
|
|
70353
|
+
// // if (this.videoElement && !this.player) {
|
|
70354
|
+
// // this.player = videojs.default(this.videoElement, this.computedVideoConfig(), function onPlayerReady() {
|
|
70355
|
+
// // self.initVideo();
|
|
70356
|
+
// // if (self.hasPoster || self.autoplay) {
|
|
70357
|
+
// // self.isPlayed = true;
|
|
70358
|
+
// // setTimeout(() => this.play(), 1);
|
|
70359
|
+
// // }
|
|
70360
|
+
// // });
|
|
70361
|
+
// // }
|
|
70362
|
+
// }
|
|
70363
|
+
// });
|
|
70364
|
+
// }, options);
|
|
70365
|
+
// observer.observe(this.hostElement);
|
|
70369
70366
|
}
|
|
70370
70367
|
onClickHandler(event) {
|
|
70371
70368
|
event.preventDefault();
|
|
@@ -70381,7 +70378,7 @@ const ContentVideo = class {
|
|
|
70381
70378
|
}
|
|
70382
70379
|
render() {
|
|
70383
70380
|
let showPlayButton = !this.autoplay && ((this.hasPoster && !this.isPlayed) || !this.isPlayed);
|
|
70384
|
-
return (index.h(index.Host, { key: '
|
|
70381
|
+
return (index.h(index.Host, { key: '22cffbd35601f37a8bbc0bd5eda02cda1688c9cc', class: this.classString }, this.hasPoster && !this.isLoaded && (index.h("div", { key: 'a49d09ea914a8fc90c3dc10bab99e74347fad000', class: "content-video__poster" }, index.h("slot", { key: 'b1e57d86ac11a2b03950bb9ffb40f73253ac838b', name: "poster" }))), showPlayButton && (index.h("button", { key: '14dbd5508a52b66ab112d2dbfd1d5de3b96310eb', class: "content-video__play", "aria-label": this.playButtonAriaLabel, onClick: ev => this.onClickHandler(ev) }, index.h("slot", { key: '6ae7662d21f79e8c05c5d17652cbb7e37533cb5d', name: "playButton" }))), index.h("div", { key: '3b942a282fd0df1e22569fd02ff248065f67374e', class: "content-video__content" }, (!this.hasPoster || this.isLoaded) && (index.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()) }, index.h("slot", { key: '8c784e20d7938cfb890d2877d208bbf514735ad4', name: "no-js-message" }), index.h("slot", { key: '351930777416a2bbc6a89a37e2e69f241a3dbf9c', name: "content" }), index.h("slot", { key: 'f06a2361d6397fca3d15a9a5533e94667a73bf15' }))))));
|
|
70385
70382
|
}
|
|
70386
70383
|
get hostElement() { return index.getElement(this); }
|
|
70387
70384
|
};
|