@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.
@@ -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
- let options = {
70343
- root: null,
70344
- rootMargin: '0px',
70345
- threshold: 0.1,
70346
- };
70347
- let observer = new IntersectionObserver(entries => {
70348
- entries.forEach(async (entry) => {
70349
- if (entry.isIntersecting) {
70350
- this.player = videojs(this.videoElement, this.computedVideoConfig());
70351
- // if (!videojs) {
70352
- // videojs = await import('video.js');
70353
- // await import('videojs-youtube/dist/Youtube.js');
70354
- // }
70355
- // this.hasPoster = !!this.hostElement.querySelector('[slot="poster"]');
70356
- // if (this.videoElement && !this.player) {
70357
- // this.player = videojs.default(this.videoElement, this.computedVideoConfig(), function onPlayerReady() {
70358
- // self.initVideo();
70359
- // if (self.hasPoster || self.autoplay) {
70360
- // self.isPlayed = true;
70361
- // setTimeout(() => this.play(), 1);
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: '4eb01a365b5cdada1754ef431c6b4d4d779d729a', class: this.classString }, this.hasPoster && !this.isLoaded && (index.h("div", { key: '13ece2dd90e34b04fc678bc0ac6b385016ac04d6', class: "content-video__poster" }, index.h("slot", { key: '47896b0f5bf7b0f3ab33131e726cb20567c121e3', name: "poster" }))), showPlayButton && (index.h("button", { key: 'ca90cce7e4ea02d2201cbaecf610fb87c11f86e1', class: "content-video__play", "aria-label": this.playButtonAriaLabel, onClick: ev => this.onClickHandler(ev) }, index.h("slot", { key: '162cf783704d2bedcb03bb91612e7d86c6f0734b', name: "playButton" }))), index.h("div", { key: '636a0de9100a7eafb18800bf1134fef64343053b', class: "content-video__content" }, (!this.hasPoster || this.isLoaded) && (index.h("video", { key: '4a3abea2af63a8e93bfc1eebca323a05a3fbcbd3', 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: '6706262c92d34dbea5400699cc61f5614253300a', name: "no-js-message" }), index.h("slot", { key: '544c42a1feb5add98941e77a362df1e97cd3fac8', name: "content" }), index.h("slot", { key: '23c39f3b87587328097e8046f888e5e8469eeef3' }))))));
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
  };