mirror of
https://github.com/sussy-code/smov.git
synced 2025-01-09 17:37:40 +01:00
19 lines
503 B
TypeScript
19 lines
503 B
TypeScript
|
import { getPlayerState } from "../cache";
|
||
|
import { VideoPlayerStateProvider } from "./providerTypes";
|
||
|
|
||
|
export function setProvider(
|
||
|
descriptor: string,
|
||
|
provider: VideoPlayerStateProvider
|
||
|
) {
|
||
|
const state = getPlayerState(descriptor);
|
||
|
state.stateProvider = provider;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Note: This only sets the state provider to null. it does not destroy the listener
|
||
|
*/
|
||
|
export function unsetStateProvider(descriptor: string) {
|
||
|
const state = getPlayerState(descriptor);
|
||
|
state.stateProvider = null;
|
||
|
}
|