byteark-player-react
Advanced tools
Comparing version 2.1.0-rc.1 to 2.1.0-rc.2
@@ -1,80 +0,8 @@ | ||
import type { ReactNode } from 'react'; | ||
import videojs from 'video.js'; | ||
export interface AutoplayResult { | ||
autoplay: boolean; | ||
muted: boolean; | ||
declare module 'byteark-player-react' { | ||
import { ComponentType } from 'react' | ||
import type { ByteArkPlayerOptions } from './src/types' | ||
const ByteArkPlayerContainer: ComponentType<ByteArkPlayerOptions & Record<string, any>> | ||
export { ByteArkPlayerContainer } | ||
} | ||
export interface ByteArkPlayer extends videojs.Player { | ||
autoplayResult_: AutoplayResult; | ||
canAutoplay(props: ByteArkPlayerOptions): Promise<AutoplayResult>; | ||
init: DefaultCreatePlayerFunction; | ||
initAsync: DefaultCreatePlayerFunction; | ||
isBrowserSupportDrm(): Promise<{ | ||
widevine: boolean; | ||
fairplay: boolean; | ||
}>; | ||
seekButtons?: boolean; | ||
setup: DefaultSetupPlayerFunction; | ||
sources: Array<ByteArkPlayerSource & Record<string, any>>; | ||
} | ||
type ByteArkPlayerPluginName = 'ads' | 'bytearkAds' | 'bytearkFirework' | 'bytearkHls' | 'bytearkLighthouse' | 'contextmenuUI' | 'seekButtons' | 'bytearkVolumeBooster' | 'bytearkRetentionChart'; | ||
export interface ByteArkPlayerSource { | ||
/** The url to the source */ | ||
src: string; | ||
/** The MIME type of the source */ | ||
type?: string | undefined; | ||
/** The video title text */ | ||
title?: string; | ||
/** The video ID for ByteArk Lighthouse implementation */ | ||
videoId?: string; | ||
/** The url of an image to be displayed before the video starts */ | ||
poster?: string; | ||
} | ||
export interface ByteArkPlayerOptions extends videojs.PlayerOptions { | ||
autoplayadsmuted?: boolean; | ||
className?: string; | ||
createPlaceholderFunction?: DefaultCreatePlaceholderFunction; | ||
createPlayerFunction?: DefaultCreatePlayerFunction; | ||
lazyload?: boolean; | ||
onPlayerCreated?: (player: ByteArkPlayer) => any; | ||
onPlayerLoaded?: () => any; | ||
onPlayerLoadError?: (error: LoadErrorMessageProps, originalError: any) => any; | ||
onReady?: (player: ByteArkPlayer) => any; | ||
onPlayerSetup?: () => any; | ||
onPlayerSetupError?: (error: LoadErrorMessageProps, originalError: any) => any; | ||
playerEndpoint?: string; | ||
playerServerEndpoint?: string; | ||
playerSlugId?: string; | ||
playerVersion?: string; | ||
playerJsFileName?: string; | ||
playerCssFileName?: string; | ||
plugins?: Record<ByteArkPlayerPluginName | string, any>[]; | ||
seekButtons?: boolean; | ||
sources: Array<ByteArkPlayerSource & Record<string, any>>; | ||
setupPlayerFunction?: DefaultSetupPlayerFunction; | ||
techCanOverridePoster?: boolean; | ||
} | ||
export type ByteArkPlayerWithAutoplayResult = ByteArkPlayerOptions & { | ||
autoplayResult_: AutoplayResult; | ||
}; | ||
export interface LoadErrorMessageProps { | ||
message?: string; | ||
messageSecondary?: string; | ||
code?: string; | ||
} | ||
export interface PlayerPlaceholderProps { | ||
aspectRatio: string | undefined; | ||
onClick: () => void; | ||
className?: string; | ||
error: LoadErrorMessageProps | null; | ||
loaded: boolean; | ||
playerOptions: ByteArkPlayerOptions; | ||
} | ||
export type DefaultCreatePlaceholderFunction = (props: ByteArkPlayerOptions, state: { | ||
error: LoadErrorMessageProps | null; | ||
loaded: boolean; | ||
}, onClickPlaceholder: () => void) => ReactNode; | ||
export type DefaultCreatePlayerFunction = (videoNode: HTMLVideoElement | HTMLAudioElement, options: ByteArkPlayerOptions | ByteArkPlayerWithAutoplayResult, onReady: () => any) => Promise<ByteArkPlayer>; | ||
export type DefaultSetupPlayerFunction = (options: ByteArkPlayerOptions, loadScriptOrStyleFunction: (id: string, url: string, type: string) => any, customOptions?: Record<string, string | Record<string, any>>) => Promise<void>; | ||
export {}; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "byteark-player-react", | ||
"version": "2.1.0-rc.1", | ||
"version": "2.1.0-rc.2", | ||
"description": "ByteArk Player Container for React", | ||
@@ -16,3 +16,3 @@ "author": "byteark", | ||
"scripts": { | ||
"build": "microbundle --no-compress --format modern,cjs --jsx React.createElement", | ||
"build": "microbundle --no-compress --format modern,cjs --jsx React.createElement && cp ./types.d.ts dist/", | ||
"start": "microbundle watch --no-compress --format modern,cjs --jsx React.createElement", | ||
@@ -19,0 +19,0 @@ "prepublish": "run-s build", |
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
139012
21
1205