@zcomponent/three-video-player 1.1.2 → 1.1.4

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/README.md CHANGED
@@ -91,10 +91,7 @@ export class MyVideoBehavior extends Behavior<VideoPlayer> {
91
91
  constructor(contextManager: ContextManager, instance: VideoPlayer) {
92
92
  super(contextManager, instance);
93
93
 
94
- // Play the video when it's loaded
95
- this.instance.load().then(() => {
96
- this.instance.play();
97
- });
94
+ console.log(this.instance.length())
98
95
 
99
96
  // Listen for the video to end
100
97
  this.register(this.instance.onEnded, () => {
@@ -1,5 +1,6 @@
1
1
  // TODO- import type and dynamic import later
2
2
  import Hls from 'hls.js';
3
+ import { registerLoadable } from '@zcomponent/core';
3
4
  import { BaseVideo } from './basevideo';
4
5
  /**
5
6
  *
@@ -22,6 +23,7 @@ export class VideoPlayer extends BaseVideo {
22
23
  super(ctx, constructorProps);
23
24
  this.constructorProps = constructorProps;
24
25
  this.hls = null;
26
+ registerLoadable(this.contextManager, this.load());
25
27
  }
26
28
  async load() {
27
29
  const isHls = this.constructorProps.source.endsWith('.m3u8');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zcomponent/three-video-player",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "HLS & MP4 Player for Mattercraft",
5
5
  "author": "Zappar Limited",
6
6
  "license": "Proprietary",