@theolive/player
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -6,3 +6,3 @@ { | ||
"types": "./types/THEOLive.d.ts", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "The official THEOlive video player.", | ||
@@ -9,0 +9,0 @@ "author": "THEO Technologies", |
@@ -0,1 +1,55 @@ | ||
import { Event } from "./Event"; | ||
import { StringKeyOf } from "./TypeUtils"; | ||
/** | ||
* This event indicates the player is no longer paused, fired when play() is called or autoplay is enabled. | ||
*/ | ||
export declare type PlayEvent = Event<'play'>; | ||
/** | ||
* This event indicates the player is now paused, fired when pause() is called. | ||
*/ | ||
export declare type PauseEvent = Event<'pause'>; | ||
/** | ||
* This event indicates the player is not paused and starts progressing playback, fired initially when the player | ||
* starts or when the player recovers from a stall. | ||
*/ | ||
export declare type PlayingEvent = Event<'playing'>; | ||
/** | ||
* This event indicates the player is not paused but stops progressing, fired when the buffer is empty. | ||
*/ | ||
export declare type WaitingEvent = Event<'waiting'>; | ||
/** | ||
* This event indicates that either the volume or the muted property of the player has changed. | ||
*/ | ||
export interface VolumeChangeEvent extends Event<'volumechange'> { | ||
readonly volume: number; | ||
readonly muted: boolean; | ||
} | ||
/** | ||
* This event indicates that a channel has been successfully loaded. | ||
*/ | ||
export interface ChannelLoadedEvent extends Event<'channelloaded'> { | ||
readonly channelId: string; | ||
} | ||
/** | ||
* This event indicates that the player has encountered a non-recoverable error. | ||
*/ | ||
export interface ErrorEvent extends Event<'error'> { | ||
readonly error: Error; | ||
} | ||
/** | ||
* This event indicates that the player notices its channel is not in a healthy state. When a fallback channel is | ||
* configured, the player will automatically fallback to that channel. Expert users can listen to this event to have | ||
* full control over how to fallback to an alternative. | ||
*/ | ||
export declare type IntentToFallbackEvent = Event<'intenttofallback'>; | ||
export interface PlayerEventMap { | ||
play: PlayEvent; | ||
pause: PauseEvent; | ||
playing: PlayingEvent; | ||
waiting: WaitingEvent; | ||
volumechange: VolumeChangeEvent; | ||
channelloaded: ChannelLoadedEvent; | ||
intenttofallback: IntentToFallbackEvent; | ||
error: ErrorEvent; | ||
} | ||
export declare class Player { | ||
@@ -9,2 +63,14 @@ /** | ||
/** | ||
* | ||
* @param type | ||
* @param listener | ||
*/ | ||
addEventListener<Type extends StringKeyOf<PlayerEventMap>>(type: Type, listener: (event: PlayerEventMap[Type]) => void): void; | ||
/** | ||
* | ||
* @param type | ||
* @param listener | ||
*/ | ||
removeEventListener<Type extends StringKeyOf<PlayerEventMap>>(type: Type, listener: (event: PlayerEventMap[Type]) => void): void; | ||
/** | ||
* Preload some channels to allow faster switching between channels. This will retrieve the metadata of all the | ||
@@ -11,0 +77,0 @@ * given channel ids and store it so next loadChannel calls are faster. |
@@ -0,2 +1,6 @@ | ||
import { Event, ReadonlyEventDispatcher } from "./Event"; | ||
export declare type PresentationMode = "inline" | "fullscreen"; | ||
export interface PresentationEventMap { | ||
'presentationmodechange': Event<'presentationmodechange'>; | ||
} | ||
/** | ||
@@ -7,3 +11,3 @@ * The presentation mode of the player, represented by a value from the following list: | ||
*/ | ||
export interface Presentation { | ||
export interface Presentation extends ReadonlyEventDispatcher<PresentationEventMap> { | ||
/** | ||
@@ -10,0 +14,0 @@ * The active presentation mode of the player. |
export { Player } from "./Player"; | ||
export * from './Event'; | ||
export declare function requiresServiceWorker(): boolean; |
import { Player as PlayerInternal } from "./Player"; | ||
import { Presentation } from "./Presentation"; | ||
export * from './Event'; | ||
export declare class Player extends PlayerInternal { | ||
@@ -4,0 +5,0 @@ get presentation(): Presentation; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
4620278
13
22456
6