@zezosoft/react-player 1.0.3 → 1.0.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.
@@ -1,9 +1,11 @@
1
1
  import { StateCreator } from "zustand";
2
- import { AdBreak, AdType } from "../../VideoPlayer/types/AdTypes";
2
+ import { AdBreak, AdProvider, AdType, ImaPlaybackApi } from "../../VideoPlayer/types/AdTypes";
3
3
  import { VideoState } from "../types/StoreTypes";
4
4
  export interface AdsState {
5
5
  isAdPlaying: boolean;
6
6
  setIsAdPlaying: (isAdPlaying: boolean) => void;
7
+ adProvider: AdProvider | null;
8
+ setAdProvider: (provider: AdProvider | null) => void;
7
9
  currentAd: AdBreak | null;
8
10
  setCurrentAd: (ad: AdBreak | null) => void;
9
11
  adType: AdType | null;
@@ -20,5 +22,17 @@ export interface AdsState {
20
22
  setMidRollQueue: (queue: AdBreak[]) => void;
21
23
  adVideoRef: HTMLVideoElement | null;
22
24
  setAdVideoRef: (ref: HTMLVideoElement | null) => void;
25
+ imaAdContainerRef: HTMLDivElement | null;
26
+ setImaAdContainerRef: (ref: HTMLDivElement | null) => void;
27
+ imaPlayback: ImaPlaybackApi | null;
28
+ setImaPlayback: (api: ImaPlaybackApi | null) => void;
29
+ imaDestroy: (() => void) | null;
30
+ setImaDestroy: (fn: (() => void) | null) => void;
31
+ /** True when the current IMA ad can become skippable (VAST skip offset). */
32
+ imaSkipEnabled: boolean;
33
+ setImaSkipEnabled: (enabled: boolean) => void;
34
+ /** True once IMA pre-roll finished, failed, or timed out (unblocks content UI). */
35
+ imaPreRollGateComplete: boolean;
36
+ setImaPreRollGateComplete: (complete: boolean) => void;
23
37
  }
24
38
  export declare const createAdsSlice: StateCreator<VideoState, [], [], AdsState>;
@@ -1,6 +1,6 @@
1
1
  import Hls from "hls.js";
2
2
  import * as dashjs from "dashjs";
3
- import { AdBreak, AdType } from "../../VideoPlayer/types/AdTypes";
3
+ import { AdBreak, AdProvider, AdType, ImaPlaybackApi } from "../../VideoPlayer/types/AdTypes";
4
4
  export type StreamType = "hls" | "dash" | "mp4" | "other";
5
5
  export interface VideoRefsState {
6
6
  videoRef: HTMLVideoElement | null;
@@ -108,6 +108,8 @@ export interface VideoErrorState {
108
108
  export interface AdsState {
109
109
  isAdPlaying: boolean;
110
110
  setIsAdPlaying: (isAdPlaying: boolean) => void;
111
+ adProvider: AdProvider | null;
112
+ setAdProvider: (provider: AdProvider | null) => void;
111
113
  currentAd: AdBreak | null;
112
114
  setCurrentAd: (ad: AdBreak | null) => void;
113
115
  adType: AdType | null;
@@ -124,6 +126,16 @@ export interface AdsState {
124
126
  setMidRollQueue: (queue: AdBreak[]) => void;
125
127
  adVideoRef: HTMLVideoElement | null;
126
128
  setAdVideoRef: (ref: HTMLVideoElement | null) => void;
129
+ imaAdContainerRef: HTMLDivElement | null;
130
+ setImaAdContainerRef: (ref: HTMLDivElement | null) => void;
131
+ imaPlayback: ImaPlaybackApi | null;
132
+ setImaPlayback: (api: ImaPlaybackApi | null) => void;
133
+ imaDestroy: (() => void) | null;
134
+ setImaDestroy: (fn: (() => void) | null) => void;
135
+ imaSkipEnabled: boolean;
136
+ setImaSkipEnabled: (enabled: boolean) => void;
137
+ imaPreRollGateComplete: boolean;
138
+ setImaPreRollGateComplete: (complete: boolean) => void;
127
139
  }
128
140
  export interface VideoState extends VideoRefsState, VideoPlaybackState, VideoTimingState, VideoControlsState, VideoQualityState, SubtitlesState, EpisodesState, IntroState, AdsState, VideoErrorState, StoreResetState {
129
141
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zezosoft/react-player",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",