@hopecloud/jetstream-player 1.0.21 → 1.0.23

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.
@@ -6,3 +6,4 @@ export declare class IFrameBuilder {
6
6
  private generateIframe;
7
7
  insertIframe(iframe: HTMLIFrameElement): void;
8
8
  }
9
+ //# sourceMappingURL=iframe-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iframe-builder.d.ts","sourceRoot":"","sources":["../src/iframe-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,qBAAa,aAAa;IACxB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAQ;gBAE5B,OAAO,EAAE,gBAAgB;IAMrC,OAAO,CAAC,cAAc;IAgBtB,YAAY,CAAC,MAAM,EAAE,iBAAiB;CASvC"}
@@ -1,7 +1,6 @@
1
1
  export class IFrameBuilder {
2
- options;
3
- iframe = null;
4
2
  constructor(options) {
3
+ this.iframe = null;
5
4
  this.options = options;
6
5
  this.iframe = this.generateIframe();
7
6
  }
@@ -6,3 +6,4 @@ export declare class IFramePiPPlugin {
6
6
  init(): void;
7
7
  destory(): void;
8
8
  }
9
+ //# sourceMappingURL=iframe-pip-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iframe-pip-plugin.d.ts","sourceRoot":"","sources":["../src/iframe-pip-plugin.ts"],"names":[],"mappings":"AAAA,qBAAa,eAAe;IAIjB,iBAAiB,EAAE,MAAM;IACzB,MAAM,EAAE,iBAAiB;IAJlC,OAAO,CAAC,QAAQ,CAAqC;gBAG5C,iBAAiB,EAAE,MAAM,EACzB,MAAM,EAAE,iBAAiB;IAQlC,IAAI;IAmCJ,OAAO;CAMR"}
@@ -1,10 +1,8 @@
1
1
  export class IFramePiPPlugin {
2
- containerSelector;
3
- iframe;
4
- observer = null;
5
2
  constructor(containerSelector, iframe) {
6
3
  this.containerSelector = containerSelector;
7
4
  this.iframe = iframe;
5
+ this.observer = null;
8
6
  this.containerSelector = containerSelector;
9
7
  this.iframe = iframe;
10
8
  this.init();
@@ -17,7 +15,6 @@ export class IFramePiPPlugin {
17
15
  throw new Error('Selector of iframe not found');
18
16
  }
19
17
  this.observer = new IntersectionObserver(([{ isIntersecting }]) => {
20
- console.log('isIntersecting', isIntersecting);
21
18
  if (!isIntersecting) {
22
19
  const height = parent.getBoundingClientRect().height;
23
20
  parent.style.height = `${height}px`;
@@ -32,7 +29,7 @@ export class IFramePiPPlugin {
32
29
  rootMargin: '0px',
33
30
  threshold: 0.1,
34
31
  });
35
- this.observer.observe(this.iframe);
32
+ this.observer.observe(parent);
36
33
  }
37
34
  destory() {
38
35
  if (this.observer) {
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export { JetStreamPlayer } from './player';
2
2
  export { PlayerEvents, PlayerGetterEvents, JetStreamPlayerOptions, PlayerCommand, PlayerEvent, PlayerCommandEvent, playerListenEvents, } from './player.type';
3
3
  export { denormalizeEventData, normalizeEventData } from './utils';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
package/dist/player.d.ts CHANGED
@@ -23,3 +23,4 @@ export declare class JetStreamPlayer {
23
23
  getDuration(): Promise<number>;
24
24
  dispose(): void;
25
25
  }
26
+ //# sourceMappingURL=player.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"player.d.ts","sourceRoot":"","sources":["../src/player.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,sBAAsB,EAGvB,MAAM,eAAe,CAAC;AAGvB,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,OAAO,CAAyB;IACxC,OAAO,CAAC,gBAAgB,CAAwC;IAEhE,OAAO,CAAC,SAAS,CAAqD;gBAE1D,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB;IA+BvD,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,qBAAqB;IAa7B,OAAO,CAAC,2BAA2B;IAInC,OAAO,CAAC,QAAQ;IAQhB,OAAO,CAAC,cAAc;IAoBtB,IAAI;IAMJ,KAAK;IAML,IAAI;IAMJ,MAAM;IAMN,MAAM,CAAC,OAAO,EAAE,MAAM;IAOtB,QAAQ;IAMR,QAAQ;IAMR,OAAO;IAMP,QAAQ;IAMR,mBAAmB;IAMnB,WAAW;IAMX,OAAO;CAUR"}
package/dist/player.js CHANGED
@@ -2,11 +2,10 @@ import { IFrameBuilder } from './iframe-builder';
2
2
  import { IFramePiPPlugin } from './iframe-pip-plugin';
3
3
  import { denormalizeEventData, normalizeEventData } from './utils';
4
4
  export class JetStreamPlayer {
5
- iframe = null;
6
- options;
7
- registeredEvents = {};
8
- iFramePiP = null;
9
5
  constructor(el, options) {
6
+ this.iframe = null;
7
+ this.registeredEvents = {};
8
+ this.iFramePiP = null;
10
9
  this.options = options;
11
10
  const iframeBuilder = new IFrameBuilder({
12
11
  selector: el,
@@ -128,8 +127,9 @@ export class JetStreamPlayer {
128
127
  });
129
128
  }
130
129
  dispose() {
130
+ var _a;
131
131
  window.removeEventListener('message', this.subscribeEventHandler.bind(this));
132
132
  this.registeredEvents = {};
133
- this.iFramePiP?.destory();
133
+ (_a = this.iFramePiP) === null || _a === void 0 ? void 0 : _a.destory();
134
134
  }
135
135
  }
@@ -20,3 +20,4 @@ export type JetStreamPlayerOptions = {
20
20
  sticky?: boolean;
21
21
  events?: Partial<Record<PlayerEvents, (value?: unknown) => void>>;
22
22
  } & Omit<IFrameBuilderOpt, 'selector'>;
23
+ //# sourceMappingURL=player.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"player.type.d.ts","sourceRoot":"","sources":["../src/player.type.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,uGASrB,CAAC;AACX,MAAM,MAAM,YAAY,GACpB,OAAO,GACP,YAAY,GACZ,MAAM,GACN,OAAO,GACP,gBAAgB,GAChB,OAAO,GACP,cAAc,GACd,OAAO,CAAC;AACZ,MAAM,MAAM,kBAAkB,GAC1B,UAAU,GACV,wBAAwB,GACxB,cAAc,GACd,WAAW,CAAC;AAChB,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,YAAY,GAAG,kBAAkB,CAAC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AACF,MAAM,MAAM,kBAAkB,GAC1B,MAAM,GACN,OAAO,GACP,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,WAAW,GACX,WAAW,CAAC;AAChB,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,kBAAkB,GAAG,kBAAkB,CAAC;IAC9C,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC;CACnE,GAAG,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC"}
package/dist/utils.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export declare const normalizeEventData: <T = unknown>(event: MessageEvent<string>) => T;
2
2
  export declare const denormalizeEventData: <T = unknown>(data: T) => string;
3
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,uBACtB,aAAa,MAAM,CAAC,MAG5B,CAAC;AAEF,eAAO,MAAM,oBAAoB,sBAAuB,CAAC,WAExD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hopecloud/jetstream-player",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "JetStream Embed Player API",
5
5
  "type": "module",
6
6
  "author": {
@@ -14,11 +14,15 @@
14
14
  "publishConfig": {
15
15
  "registry": "https://npm.pkg.github.com/"
16
16
  },
17
+ "source": "src/index.ts",
17
18
  "main": "dist/index.js",
18
19
  "types": "dist/index.d.ts",
19
20
  "exports": {
20
21
  ".": {
21
- "import": "./dist/index.js"
22
+ "import": {
23
+ "types": "./dist/index.d.ts",
24
+ "default": "./dist/index.js"
25
+ }
22
26
  },
23
27
  "./dist/main.css": {
24
28
  "import": "./dist/main.css"