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