jwplayer-capacitor
v7.0.1
Published
Integration of JWPlayer Web and Mobile SDKs with Capacitor
Readme
jwplayer-capacitor
Integration of JWPlayer Web and Mobile SDKs with Capacitor
Install
npm install jwplayer-capacitor
npx cap syncAPI
echo(...)initialize(...)create(...)remove()getPosition()seek(...)addButton(...)addCuePoints(...)playlistItem(...)addListener('playerEvent', ...)addListener('fullScreenPlayerEvent', ...)addListener('readyPlayerEvent', ...)removeAllListeners()- Interfaces
- Type Aliases
echo(...)
echo(options: { value: string; }) => Promise<{ value: string; }>| Param | Type |
| ------------- | ------------------------------- |
| options | { value: string; } |
Returns: Promise<{ value: string; }>
initialize(...)
initialize(options: { webLicenseKey?: string; androidLicenseKey?: string; iosLicenseKey?: string; googleCastId?: string; debug?: boolean; }) => Promise<any>| Param | Type |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| options | { webLicenseKey?: string; androidLicenseKey?: string; iosLicenseKey?: string; googleCastId?: string; debug?: boolean; } |
Returns: Promise<any>
create(...)
create(options: { webConfiguration?: { container: string; properties?: any; }; nativeConfiguration?: JWPlayerNativeConfiguration; advertisingConfig?: JWPlayerAd; }) => Promise<any>| Param | Type |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| options | { webConfiguration?: { container: string; properties?: any; }; nativeConfiguration?: JWPlayerNativeConfiguration; advertisingConfig?: JWPlayerAd; } |
Returns: Promise<any>
remove()
remove() => Promise<any>Returns: Promise<any>
getPosition()
getPosition() => Promise<{ value: number; }>Returns: Promise<{ value: number; }>
seek(...)
seek(options: { position: number; }) => Promise<any>| Param | Type |
| ------------- | ---------------------------------- |
| options | { position: number; } |
Returns: Promise<any>
addButton(...)
addButton(img: string, tooltip: string, callback: () => void, id: string, btnClass: string) => void| Param | Type |
| -------------- | -------------------------- |
| img | string |
| tooltip | string |
| callback | () => void |
| id | string |
| btnClass | string |
addCuePoints(...)
addCuePoints(options: { cuePoints: JWPlayerCuePoint[]; }) => void| Param | Type |
| ------------- | ----------------------------------------------- |
| options | { cuePoints: JWPlayerCuePoint[]; } |
playlistItem(...)
playlistItem(options: { index: number; }) => Promise<any>| Param | Type |
| ------------- | ------------------------------- |
| options | { index: number; } |
Returns: Promise<any>
addListener('playerEvent', ...)
addListener(eventName: 'playerEvent', listenerFunc: EventChangeListener) => Promise<PluginListenerHandle>Listen for events in player
| Param | Type |
| ------------------ | ------------------------------------------------------------------- |
| eventName | 'playerEvent' |
| listenerFunc | EventChangeListener |
Returns: Promise<PluginListenerHandle>
Since: 1.0.0
addListener('fullScreenPlayerEvent', ...)
addListener(eventName: 'fullScreenPlayerEvent', listenerFunc: EventChangeListener) => Promise<PluginListenerHandle>| Param | Type |
| ------------------ | ------------------------------------------------------------------- |
| eventName | 'fullScreenPlayerEvent' |
| listenerFunc | EventChangeListener |
Returns: Promise<PluginListenerHandle>
addListener('readyPlayerEvent', ...)
addListener(eventName: 'readyPlayerEvent', listenerFunc: EventChangeListener) => Promise<PluginListenerHandle>| Param | Type |
| ------------------ | ------------------------------------------------------------------- |
| eventName | 'readyPlayerEvent' |
| listenerFunc | EventChangeListener |
Returns: Promise<PluginListenerHandle>
removeAllListeners()
removeAllListeners() => Promise<void>Remove all listeners (including the network status changes) for this plugin.
Since: 1.0.0
Interfaces
JWPlayerNativeConfiguration
| Prop | Type |
| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| width | number |
| height | number |
| x | number |
| y | number |
| googleCastId | string |
| front | boolean |
| autostart | boolean |
| forceFullScreenOnLandscape | boolean |
| forceFullScreen | boolean |
| playlist | { file: string; image: string; title: string; description: string; starttime: number; captions: { file: string; label: string; default?: boolean; }[]; }[] |
JWPlayerAd
| Prop | Type |
| -------------- | --------------------------------- |
| type | string |
| schedule | JWPlayerAdSchedule[] |
JWPlayerAdSchedule
| Prop | Type |
| ----------- | ------------------- |
| url | string |
| begin | number |
JWPlayerCuePoint
| Prop | Type |
| ----------- | ------------------- |
| type | string |
| text | string |
| begin | number |
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove | () => Promise<void> |
JWPlayerEvent
| Prop | Type | Description | Since |
| ---------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----- |
| name | string | Whether there is an active connection or not. | 1.0.0 |
| data | any | The type of network connection currently in use. If there is no active network connection, connectionType will be 'none'. | 1.0.0 |
Type Aliases
EventChangeListener
(event: JWPlayerEvent): void
