react-native-theoplayer 2.10.0 → 2.11.0
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.
- package/CHANGELOG.md +17 -1
- package/README.md +11 -9
- package/android/src/main/java/com/theoplayer/PlayerEventEmitter.kt +1 -1
- package/android/src/main/java/com/theoplayer/player/PlayerModule.kt +10 -0
- package/android/src/main/java/com/theoplayer/presentation/PipUtils.kt +16 -9
- package/android/src/main/java/com/theoplayer/track/TextTrackStyleAdapter.kt +79 -0
- package/android/src/main/java/com/theoplayer/util/ViewResolver.kt +6 -0
- package/ios/THEOplayerRCTBridge.m +3 -0
- package/ios/THEOplayerRCTPlayerAPI.swift +52 -0
- package/ios/THEOplayerRCTTypeUtils.swift +15 -0
- package/ios/ads/THEOplayerRCTAdsAPI+DAI.swift +1 -1
- package/ios/ads/THEOplayerRCTSourceDescriptionBuilder+Ads.swift +1 -1
- package/ios/ads/THEOplayerRCTView+AdsConfig.swift +1 -1
- package/ios/backgroundAudio/THEOplayerRCTNowPlayingManager.swift +3 -3
- package/lib/commonjs/api/track/TextTrackStyle.js +29 -0
- package/lib/commonjs/api/track/TextTrackStyle.js.map +1 -1
- package/lib/commonjs/internal/adapter/track/NamedColors.json +143 -0
- package/lib/commonjs/internal/adapter/track/TextTrackStyleAdapter.js +118 -22
- package/lib/commonjs/internal/adapter/track/TextTrackStyleAdapter.js.map +1 -1
- package/lib/commonjs/internal/adapter/web/WebMediaSession.js +1 -1
- package/lib/commonjs/internal/adapter/web/WebMediaSession.js.map +1 -1
- package/lib/module/api/track/TextTrackStyle.js +23 -0
- package/lib/module/api/track/TextTrackStyle.js.map +1 -1
- package/lib/module/internal/adapter/track/NamedColors.json +143 -0
- package/lib/module/internal/adapter/track/TextTrackStyleAdapter.js +117 -22
- package/lib/module/internal/adapter/track/TextTrackStyleAdapter.js.map +1 -1
- package/lib/module/internal/adapter/web/WebMediaSession.js +1 -1
- package/lib/module/internal/adapter/web/WebMediaSession.js.map +1 -1
- package/lib/typescript/api/track/TextTrackStyle.d.ts +43 -5
- package/lib/typescript/internal/adapter/track/TextTrackStyleAdapter.d.ts +26 -8
- package/package.json +1 -1
- package/react-native-theoplayer.podspec +1 -1
- package/src/api/track/TextTrackStyle.ts +45 -5
- package/src/internal/adapter/track/NamedColors.json +143 -0
- package/src/internal/adapter/track/TextTrackStyleAdapter.ts +132 -21
- package/src/internal/adapter/web/WebMediaSession.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TextTrackStyleAdapter","constructor","
|
|
1
|
+
{"version":3,"names":["NativeModules","NamedColors","namedColorsMap","TextTrackStyleAdapter","constructor","_view","_defineProperty","undefined","backgroundColor","_backgroundColor","color","PlayerModule","setTextTrackStyle","nativeHandle","convertColorToRGBA","edgeStyle","_edgeStyle","style","fontColor","_fontColor","fontFamily","_fontFamily","family","fontSize","_fontSize","size","fromPercentage","windowColor","_windowColor","marginBottom","_marginBottom","margin","marginLeft","_marginLeft","marginRight","_marginRight","marginTop","_marginTop","replace","toLowerCase","colorPattern","match","r","parseInt","g","b","a","pct","parseFloat"],"sources":["TextTrackStyleAdapter.ts"],"sourcesContent":["import type { EdgeStyle, TextTrackStyle, THEOplayerView } from 'react-native-theoplayer';\nimport { NativeModules } from 'react-native';\nimport NamedColors from './NamedColors.json';\n\nconst namedColorsMap = NamedColors as { [name: string]: string };\n\nexport class TextTrackStyleAdapter implements TextTrackStyle {\n private _backgroundColor: string | undefined = undefined;\n private _edgeStyle: EdgeStyle | undefined = undefined;\n private _fontColor: string | undefined = undefined;\n private _fontFamily: string | undefined = undefined;\n private _fontSize: string | undefined = undefined;\n private _windowColor: string | undefined = undefined;\n private _marginBottom: number | undefined = undefined;\n private _marginTop: number | undefined = undefined;\n private _marginLeft: number | undefined = undefined;\n private _marginRight: number | undefined = undefined;\n\n constructor(private readonly _view: THEOplayerView) {}\n\n get backgroundColor(): string | undefined {\n return this._backgroundColor;\n }\n\n set backgroundColor(color: string | undefined) {\n this._backgroundColor = color;\n NativeModules.PlayerModule.setTextTrackStyle(this._view.nativeHandle, {\n backgroundColor: convertColorToRGBA(color),\n });\n }\n\n get edgeStyle(): EdgeStyle | undefined {\n return this._edgeStyle;\n }\n\n set edgeStyle(style: EdgeStyle | undefined) {\n this._edgeStyle = style;\n NativeModules.PlayerModule.setTextTrackStyle(this._view.nativeHandle, {\n edgeStyle: style,\n });\n }\n\n get fontColor(): string | undefined {\n return this._fontColor;\n }\n\n set fontColor(color: string | undefined) {\n this._fontColor = color;\n NativeModules.PlayerModule.setTextTrackStyle(this._view.nativeHandle, {\n fontColor: convertColorToRGBA(color),\n });\n }\n\n get fontFamily(): string | undefined {\n return this._fontFamily;\n }\n\n set fontFamily(family: string | undefined) {\n this._fontFamily = family;\n NativeModules.PlayerModule.setTextTrackStyle(this._view.nativeHandle, {\n fontFamily: family,\n });\n }\n\n get fontSize(): string | undefined {\n return this._fontSize;\n }\n\n set fontSize(size: string | undefined) {\n this._fontSize = size;\n NativeModules.PlayerModule.setTextTrackStyle(this._view.nativeHandle, {\n fontSize: fromPercentage(size),\n });\n }\n\n get windowColor(): string | undefined {\n return this._windowColor;\n }\n\n set windowColor(color: string | undefined) {\n this._windowColor = color;\n NativeModules.PlayerModule.setTextTrackStyle(this._view.nativeHandle, {\n windowColor: convertColorToRGBA(color),\n });\n }\n\n get marginBottom(): number | undefined {\n return this._marginBottom;\n }\n\n set marginBottom(margin: number | undefined) {\n this._marginBottom = margin;\n NativeModules.PlayerModule.setTextTrackStyle(this._view.nativeHandle, {\n marginBottom: margin,\n });\n }\n\n get marginLeft(): number | undefined {\n return this._marginLeft;\n }\n\n set marginLeft(margin: number | undefined) {\n this._marginLeft = margin;\n NativeModules.PlayerModule.setTextTrackStyle(this._view.nativeHandle, {\n marginLeft: margin,\n });\n }\n\n get marginRight(): number | undefined {\n return this._marginRight;\n }\n\n set marginRight(margin: number | undefined) {\n this._marginRight = margin;\n NativeModules.PlayerModule.setTextTrackStyle(this._view.nativeHandle, {\n marginRight: margin,\n });\n }\n\n get marginTop(): number | undefined {\n return this._marginTop;\n }\n\n set marginTop(margin: number | undefined) {\n this._marginTop = margin;\n NativeModules.PlayerModule.setTextTrackStyle(this._view.nativeHandle, {\n marginTop: margin,\n });\n }\n}\n\ninterface BridgeColor {\n r: number;\n g: number;\n b: number;\n a: number;\n}\n\nfunction convertColorToRGBA(color: string | undefined): BridgeColor | null {\n if (!color) {\n return null;\n }\n\n color = color.replace('#', '');\n\n if (namedColorsMap[color.toLowerCase()]) {\n color = namedColorsMap[color.toLowerCase()];\n }\n\n const colorPattern = /^(?:#|0x)?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})?$/i;\n const match = color.match(colorPattern);\n\n if (!match) {\n return null;\n }\n\n const r = parseInt(match[1], 16);\n const g = parseInt(match[2], 16);\n const b = parseInt(match[3], 16);\n const a = match[4] ? parseInt(match[4], 16) : 255;\n return { r, g, b, a };\n}\n\nfunction fromPercentage(pct: string | undefined): number {\n return pct ? parseFloat(pct) : 100;\n}\n"],"mappings":";;;AACA,SAASA,aAAa,QAAQ,cAAc;AAC5C,OAAOC,WAAW,MAAM,oBAAoB;AAE5C,MAAMC,cAAc,GAAGD,WAAyC;AAEhE,OAAO,MAAME,qBAAqB,CAA2B;EAY3DC,WAAWA,CAAkBC,KAAqB,EAAE;IAAA,KAAvBA,KAAqB,GAArBA,KAAqB;IAAAC,eAAA,2BAXHC,SAAS;IAAAD,eAAA,qBACZC,SAAS;IAAAD,eAAA,qBACZC,SAAS;IAAAD,eAAA,sBACRC,SAAS;IAAAD,eAAA,oBACXC,SAAS;IAAAD,eAAA,uBACNC,SAAS;IAAAD,eAAA,wBACRC,SAAS;IAAAD,eAAA,qBACZC,SAAS;IAAAD,eAAA,sBACRC,SAAS;IAAAD,eAAA,uBACRC,SAAS;EAEC;EAErD,IAAIC,eAAeA,CAAA,EAAuB;IACxC,OAAO,IAAI,CAACC,gBAAgB;EAC9B;E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cA,CAACqB,GAAuB,EAAU;EACvD,OAAOA,GAAG,GAAGC,UAAU,CAACD,GAAG,CAAC,GAAG,GAAG;AACpC"}
|
|
@@ -45,7 +45,7 @@ export class WebMediaSession {
|
|
|
45
45
|
_defineProperty(this, "updateMetadata", () => {
|
|
46
46
|
const source = this._player.source;
|
|
47
47
|
const metadata = source === null || source === void 0 ? void 0 : source.metadata;
|
|
48
|
-
const artwork = [
|
|
48
|
+
const artwork = [metadata === null || metadata === void 0 ? void 0 : metadata.displayIconUri, source === null || source === void 0 ? void 0 : source.poster, ...(metadata !== null && metadata !== void 0 && metadata.images ? metadata === null || metadata === void 0 ? void 0 : metadata.images : [])].filter(image => image !== undefined).map(image => {
|
|
49
49
|
if (typeof image === 'string') {
|
|
50
50
|
return {
|
|
51
51
|
src: image
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["defaultWebMediaSessionConfig","skipTime","NoOp","mediaSession","_navigator$mediaSessi","_navigator$mediaSessi2","navigator","setActionHandler","setPositionState","window","MediaMetadata","WebMediaSession","constructor","adapter","player","_this$_player$ads","_this$_player$ads2","config","arguments","length","undefined","_defineProperty","updateMetadata","updatePositionState","updateActionHandlers","source","_player","metadata","artwork","poster","displayIconUri","images","filter","image","map","src","title","artist","subtitle","album","duration","playbackRate","currentTime","isLive","isFinite","isNaN","position","_webAdapter","_config","addEventListener","onSourceChange","onLoadedMetadata","onDurationChange","ads","onAdbreakBegin","onAdbreakEnd","isTrickplayEnabled","event","seekOffset","Math","max","min","isPlayPauseEnabled","_this$_player","play","_this$_player2","pause","destroy","_this$_player$ads3","_this$_player$ads4","removeEventListener","isInAd","_this$_player$ads5","playing","isInBackground","document","visibilityState","isBackgroundAudioEnabled","backgroundAudioConfiguration","enabled"],"sources":["WebMediaSession.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { ChromelessPlayer } from 'theoplayer';\nimport type { THEOplayerWebAdapter } from '../THEOplayerWebAdapter';\n\ninterface WebMediaSessionConfig {\n skipTime: number;\n}\n\nexport const defaultWebMediaSessionConfig: WebMediaSessionConfig = {\n skipTime: 15,\n};\n\nconst NoOp = () => {};\n\n// This prevents unnecessary errors when Media Session API is not available.\nconst mediaSession = (function () {\n const mediaSession = navigator.mediaSession || {};\n mediaSession.setActionHandler = navigator.mediaSession?.setActionHandler || function () {};\n mediaSession.setPositionState = navigator.mediaSession?.setPositionState || function () {};\n window.MediaMetadata = window.MediaMetadata || function () {};\n return mediaSession;\n})();\n\n/**\n * The MediaSession interface of the Media Session API allows a web page to provide custom behaviors for standard media playback interactions, and\n * to report metadata that can be sent by the user agent to the device or operating system for presentation in standardized user interface elements.\n *\n * @link https://w3c.github.io/mediasession\n */\nexport class WebMediaSession {\n private readonly _config: WebMediaSessionConfig;\n private readonly _player: ChromelessPlayer;\n private readonly _webAdapter: THEOplayerWebAdapter;\n\n constructor(adapter: THEOplayerWebAdapter, player: ChromelessPlayer, config: WebMediaSessionConfig = defaultWebMediaSessionConfig) {\n this._player = player;\n this._webAdapter = adapter;\n this._config = config;\n\n this._player.addEventListener('sourcechange', this.onSourceChange);\n this._player.addEventListener('loadedmetadata', this.onLoadedMetadata);\n this._player.addEventListener('durationchange', this.onDurationChange);\n this._player.ads?.addEventListener('adbreakbegin', this.onAdbreakBegin);\n this._player.ads?.addEventListener('adbreakend', this.onAdbreakEnd);\n this.updateActionHandlers();\n }\n\n updateActionHandlers() {\n if (this.isTrickplayEnabled()) {\n mediaSession.setActionHandler('seekbackward', (event) => {\n const skipTime = event.seekOffset || this._config.skipTime;\n this._player.currentTime = Math.max(this._player.currentTime - skipTime, 0);\n });\n mediaSession.setActionHandler('seekforward', (event) => {\n const skipTime = event.seekOffset || this._config.skipTime;\n this._player.currentTime = Math.min(this._player.currentTime + skipTime, this._player.duration);\n });\n } else {\n mediaSession.setActionHandler('seekbackward', NoOp);\n mediaSession.setActionHandler('seekforward', NoOp);\n }\n\n if (this.isPlayPauseEnabled()) {\n mediaSession.setActionHandler('play', () => {\n this._player?.play();\n });\n mediaSession?.setActionHandler('pause', () => {\n this._player?.pause();\n });\n } else {\n mediaSession.setActionHandler('play', NoOp);\n mediaSession.setActionHandler('pause', NoOp);\n }\n }\n\n destroy() {\n this._player.removeEventListener('sourcechange', this.onSourceChange);\n this._player.removeEventListener('loadedmetadata', this.onLoadedMetadata);\n this._player.removeEventListener('durationchange', this.onDurationChange);\n this._player.ads?.removeEventListener('adbreakbegin', this.onAdbreakBegin);\n this._player.ads?.removeEventListener('adbreakend', this.onAdbreakEnd);\n mediaSession.setActionHandler('play', NoOp);\n mediaSession.setActionHandler('pause', NoOp);\n mediaSession.setActionHandler('seekbackward', NoOp);\n mediaSession.setActionHandler('seekforward', NoOp);\n }\n\n private onSourceChange = () => {\n this.updateMetadata();\n this.updatePositionState();\n this.updateActionHandlers();\n };\n\n private onLoadedMetadata = () => {\n this.updateActionHandlers();\n };\n\n private onDurationChange = () => {\n this.updateActionHandlers();\n };\n\n private updateMetadata = () => {\n const source = this._player.source;\n const metadata = source?.metadata;\n const artwork = [source?.poster, metadata?.displayIconUri, ...(metadata?.images ? metadata?.images : [])]\n .filter((image) => image !== undefined)\n .map((image) => {\n if (typeof image === 'string') {\n return { src: image };\n }\n return image;\n });\n mediaSession.metadata = new MediaMetadata({\n title: metadata?.title,\n artist: metadata?.artist || metadata?.subtitle,\n album: metadata?.album,\n artwork,\n });\n };\n\n private updatePositionState = () => {\n const { duration, playbackRate, currentTime } = this._player;\n const isLive = !isFinite(duration);\n if (!isLive) {\n mediaSession.setPositionState({\n // The duration is used to specify the duration in seconds.\n // It should always be positive and positive infinity can be used to indicate media without a defined end such as live playback.\n // NOTE: passing Infinite causes an exception to be thrown.\n duration: isNaN(duration) || duration < 0 ? 0 : duration,\n\n // The playbackRate is used to specify the playback rate.\n // It can be positive to represent forward playback or negative to represent backwards playback. It should not be zero.\n playbackRate,\n\n // The position is used to specify the last reported playback position in seconds. It should always be positive.\n position: currentTime,\n });\n }\n };\n\n private onAdbreakBegin = () => {\n this.updateActionHandlers();\n };\n\n private onAdbreakEnd = () => {\n this.updateActionHandlers();\n };\n\n private isLive(): boolean {\n return !isFinite(this._player.duration);\n }\n\n private isInAd(): boolean {\n return this._player.ads?.playing === true;\n }\n\n private isInBackground(): boolean {\n return document.visibilityState !== 'visible';\n }\n\n // By default, only show trick-play buttons if:\n // - backgroundAudio is enabled, or the player is in foreground;\n // - and, the current asset is neither a live stream, nor an ad.\n private isTrickplayEnabled(): boolean {\n return (this.isBackgroundAudioEnabled() || !this.isInBackground()) && !this.isLive() && !this.isInAd();\n }\n\n // By default, only show a play/pause button if:\n // - backgroundAudio is enabled, or the player is in foreground;\n // - and, the current asset is not an ad.\n private isPlayPauseEnabled(): boolean {\n return (this.isBackgroundAudioEnabled() || !this.isInBackground()) && !this.isInAd();\n }\n\n private isBackgroundAudioEnabled(): boolean {\n return this._webAdapter.backgroundAudioConfiguration.enabled === true;\n }\n}\n"],"mappings":";;;AAAA;;AAQA,OAAO,MAAMA,4BAAmD,GAAG;EACjEC,QAAQ,EAAE;AACZ,CAAC;AAED,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAErB;AACA,MAAMC,YAAY,GAAI,YAAY;EAAA,IAAAC,qBAAA,EAAAC,sBAAA;EAChC,MAAMF,YAAY,GAAGG,SAAS,CAACH,YAAY,IAAI,CAAC,CAAC;EACjDA,YAAY,CAACI,gBAAgB,GAAG,EAAAH,qBAAA,GAAAE,SAAS,CAACH,YAAY,cAAAC,qBAAA,uBAAtBA,qBAAA,CAAwBG,gBAAgB,KAAI,YAAY,CAAC,CAAC;EAC1FJ,YAAY,CAACK,gBAAgB,GAAG,EAAAH,sBAAA,GAAAC,SAAS,CAACH,YAAY,cAAAE,sBAAA,uBAAtBA,sBAAA,CAAwBG,gBAAgB,KAAI,YAAY,CAAC,CAAC;EAC1FC,MAAM,CAACC,aAAa,GAAGD,MAAM,CAACC,aAAa,IAAI,YAAY,CAAC,CAAC;EAC7D,OAA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_navigator$mediaSessi2","navigator","setActionHandler","setPositionState","window","MediaMetadata","WebMediaSession","constructor","adapter","player","_this$_player$ads","_this$_player$ads2","config","arguments","length","undefined","_defineProperty","updateMetadata","updatePositionState","updateActionHandlers","source","_player","metadata","artwork","displayIconUri","poster","images","filter","image","map","src","title","artist","subtitle","album","duration","playbackRate","currentTime","isLive","isFinite","isNaN","position","_webAdapter","_config","addEventListener","onSourceChange","onLoadedMetadata","onDurationChange","ads","onAdbreakBegin","onAdbreakEnd","isTrickplayEnabled","event","seekOffset","Math","max","min","isPlayPauseEnabled","_this$_player","play","_this$_player2","pause","destroy","_this$_player$ads3","_this$_player$ads4","removeEventListener","isInAd","_this$_player$ads5","playing","isInBackground","document","visibilityState","isBackgroundAudioEnabled","backgroundAudioConfiguration","enabled"],"sources":["WebMediaSession.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { ChromelessPlayer } from 'theoplayer';\nimport type { THEOplayerWebAdapter } from '../THEOplayerWebAdapter';\n\ninterface WebMediaSessionConfig {\n skipTime: number;\n}\n\nexport const defaultWebMediaSessionConfig: WebMediaSessionConfig = {\n skipTime: 15,\n};\n\nconst NoOp = () => {};\n\n// This prevents unnecessary errors when Media Session API is not available.\nconst mediaSession = (function () {\n const mediaSession = navigator.mediaSession || {};\n mediaSession.setActionHandler = navigator.mediaSession?.setActionHandler || function () {};\n mediaSession.setPositionState = navigator.mediaSession?.setPositionState || function () {};\n window.MediaMetadata = window.MediaMetadata || function () {};\n return mediaSession;\n})();\n\n/**\n * The MediaSession interface of the Media Session API allows a web page to provide custom behaviors for standard media playback interactions, and\n * to report metadata that can be sent by the user agent to the device or operating system for presentation in standardized user interface elements.\n *\n * @link https://w3c.github.io/mediasession\n */\nexport class WebMediaSession {\n private readonly _config: WebMediaSessionConfig;\n private readonly _player: ChromelessPlayer;\n private readonly _webAdapter: THEOplayerWebAdapter;\n\n constructor(adapter: THEOplayerWebAdapter, player: ChromelessPlayer, config: WebMediaSessionConfig = defaultWebMediaSessionConfig) {\n this._player = player;\n this._webAdapter = adapter;\n this._config = config;\n\n this._player.addEventListener('sourcechange', this.onSourceChange);\n this._player.addEventListener('loadedmetadata', this.onLoadedMetadata);\n this._player.addEventListener('durationchange', this.onDurationChange);\n this._player.ads?.addEventListener('adbreakbegin', this.onAdbreakBegin);\n this._player.ads?.addEventListener('adbreakend', this.onAdbreakEnd);\n this.updateActionHandlers();\n }\n\n updateActionHandlers() {\n if (this.isTrickplayEnabled()) {\n mediaSession.setActionHandler('seekbackward', (event) => {\n const skipTime = event.seekOffset || this._config.skipTime;\n this._player.currentTime = Math.max(this._player.currentTime - skipTime, 0);\n });\n mediaSession.setActionHandler('seekforward', (event) => {\n const skipTime = event.seekOffset || this._config.skipTime;\n this._player.currentTime = Math.min(this._player.currentTime + skipTime, this._player.duration);\n });\n } else {\n mediaSession.setActionHandler('seekbackward', NoOp);\n mediaSession.setActionHandler('seekforward', NoOp);\n }\n\n if (this.isPlayPauseEnabled()) {\n mediaSession.setActionHandler('play', () => {\n this._player?.play();\n });\n mediaSession?.setActionHandler('pause', () => {\n this._player?.pause();\n });\n } else {\n mediaSession.setActionHandler('play', NoOp);\n mediaSession.setActionHandler('pause', NoOp);\n }\n }\n\n destroy() {\n this._player.removeEventListener('sourcechange', this.onSourceChange);\n this._player.removeEventListener('loadedmetadata', this.onLoadedMetadata);\n this._player.removeEventListener('durationchange', this.onDurationChange);\n this._player.ads?.removeEventListener('adbreakbegin', this.onAdbreakBegin);\n this._player.ads?.removeEventListener('adbreakend', this.onAdbreakEnd);\n mediaSession.setActionHandler('play', NoOp);\n mediaSession.setActionHandler('pause', NoOp);\n mediaSession.setActionHandler('seekbackward', NoOp);\n mediaSession.setActionHandler('seekforward', NoOp);\n }\n\n private onSourceChange = () => {\n this.updateMetadata();\n this.updatePositionState();\n this.updateActionHandlers();\n };\n\n private onLoadedMetadata = () => {\n this.updateActionHandlers();\n };\n\n private onDurationChange = () => {\n this.updateActionHandlers();\n };\n\n private updateMetadata = () => {\n const source = this._player.source;\n const metadata = source?.metadata;\n const artwork = [metadata?.displayIconUri, source?.poster, ...(metadata?.images ? metadata?.images : [])]\n .filter((image) => image !== undefined)\n .map((image) => {\n if (typeof image === 'string') {\n return { src: image };\n }\n return image;\n });\n mediaSession.metadata = new MediaMetadata({\n title: metadata?.title,\n artist: metadata?.artist || metadata?.subtitle,\n album: metadata?.album,\n artwork,\n });\n };\n\n private updatePositionState = () => {\n const { duration, playbackRate, currentTime } = this._player;\n const isLive = !isFinite(duration);\n if (!isLive) {\n mediaSession.setPositionState({\n // The duration is used to specify the duration in seconds.\n // It should always be positive and positive infinity can be used to indicate media without a defined end such as live playback.\n // NOTE: passing Infinite causes an exception to be thrown.\n duration: isNaN(duration) || duration < 0 ? 0 : duration,\n\n // The playbackRate is used to specify the playback rate.\n // It can be positive to represent forward playback or negative to represent backwards playback. It should not be zero.\n playbackRate,\n\n // The position is used to specify the last reported playback position in seconds. It should always be positive.\n position: currentTime,\n });\n }\n };\n\n private onAdbreakBegin = () => {\n this.updateActionHandlers();\n };\n\n private onAdbreakEnd = () => {\n this.updateActionHandlers();\n };\n\n private isLive(): boolean {\n return !isFinite(this._player.duration);\n }\n\n private isInAd(): boolean {\n return this._player.ads?.playing === true;\n }\n\n private isInBackground(): boolean {\n return document.visibilityState !== 'visible';\n }\n\n // By default, only show trick-play buttons if:\n // - backgroundAudio is enabled, or the player is in foreground;\n // - and, the current asset is neither a live stream, nor an ad.\n private isTrickplayEnabled(): boolean {\n return (this.isBackgroundAudioEnabled() || !this.isInBackground()) && !this.isLive() && !this.isInAd();\n }\n\n // By default, only show a play/pause button if:\n // - backgroundAudio is enabled, or the player is in foreground;\n // - and, the current asset is not an ad.\n private isPlayPauseEnabled(): boolean {\n return (this.isBackgroundAudioEnabled() || !this.isInBackground()) && !this.isInAd();\n }\n\n private isBackgroundAudioEnabled(): boolean {\n return this._webAdapter.backgroundAudioConfiguration.enabled === true;\n }\n}\n"],"mappings":";;;A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cA,CAAA,EAAY;IAChC,OAAOC,QAAQ,CAACC,eAAe,KAAK,SAAS;EAC/C;;EAEA;EACA;EACA;EACQpB,kBAAkBA,CAAA,EAAY;IACpC,OAAO,CAAC,IAAI,CAACqB,wBAAwB,EAAE,IAAI,CAAC,IAAI,CAACH,cAAc,EAAE,KAAK,CAAC,IAAI,CAAC/B,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC4B,MAAM,EAAE;EACxG;;EAEA;EACA;EACA;EACQT,kBAAkBA,CAAA,EAAY;IACpC,OAAO,CAAC,IAAI,CAACe,wBAAwB,EAAE,IAAI,CAAC,IAAI,CAACH,cAAc,EAAE,KAAK,CAAC,IAAI,CAACH,MAAM,EAAE;EACtF;EAEQM,wBAAwBA,CAAA,EAAY;IAC1C,OAAO,IAAI,CAAC9B,WAAW,CAAC+B,4BAA4B,CAACC,OAAO,KAAK,IAAI;EACvE;AACF"}
|
|
@@ -14,7 +14,7 @@ export interface TextTrackStyle {
|
|
|
14
14
|
* @example
|
|
15
15
|
* <br/> - `red` will set the color of the text to red.
|
|
16
16
|
* <br/> - `#ff0000` will set the color of the text to red.
|
|
17
|
-
* <br/> - `rgba(255,0,0,0.5)` will set the color of the text to red, with 50% opacity.
|
|
17
|
+
* <br/> - Available on Web only: `rgba(255,0,0,0.5)` will set the color of the text to red, with 50% opacity.
|
|
18
18
|
*/
|
|
19
19
|
fontColor: string | undefined;
|
|
20
20
|
/**
|
|
@@ -33,19 +33,20 @@ export interface TextTrackStyle {
|
|
|
33
33
|
* @example
|
|
34
34
|
* <br/> - `red` will set the background color of the text track to red.
|
|
35
35
|
* <br/> - `#ff0000` will set the background color of the text track to red.
|
|
36
|
-
* <br/> - `rgba(255,0,0,0.5)` will set the background color of the text track to red, with 50% opacity.
|
|
36
|
+
* <br/> - Available on Web only: `rgba(255,0,0,0.5)` will set the background color of the text track to red, with 50% opacity.
|
|
37
37
|
*/
|
|
38
38
|
backgroundColor: string | undefined;
|
|
39
39
|
/**
|
|
40
40
|
* The window color for the text track.
|
|
41
41
|
*
|
|
42
42
|
* @remarks
|
|
43
|
-
* This targets the area covering the full width of the text track.
|
|
43
|
+
* <br/> - This targets the area covering the full width of the text track.
|
|
44
|
+
* <br/> - Available on Web and Android only.
|
|
44
45
|
*
|
|
45
46
|
* @example
|
|
46
47
|
* <br/> - `red` will set the background color of the window of the text track to red.
|
|
47
48
|
* <br/> - `#ff0000` will set the background color of the window of the text track to red.
|
|
48
|
-
* <br/> - `rgba(255,0,0,0.5)` will set the background color of the window of the text track to red, with 50% opacity.
|
|
49
|
+
* <br/> - Available on Web only: `rgba(255,0,0,0.5)` will set the background color of the window of the text track to red, with 50% opacity.
|
|
49
50
|
*/
|
|
50
51
|
windowColor: string | undefined;
|
|
51
52
|
/**
|
|
@@ -57,6 +58,37 @@ export interface TextTrackStyle {
|
|
|
57
58
|
* <br/> - `'uniform`
|
|
58
59
|
*/
|
|
59
60
|
edgeStyle: EdgeStyle | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* The top margin of the area where subtitles are being rendered.
|
|
63
|
+
*
|
|
64
|
+
* @remarks
|
|
65
|
+
* <br/> - The margin is in number of pixels.
|
|
66
|
+
*/
|
|
67
|
+
marginTop: number | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* The bottom margin of the area where subtitles are being rendered.
|
|
70
|
+
*
|
|
71
|
+
* @remarks
|
|
72
|
+
* <br/> - The margin is in number of pixels.
|
|
73
|
+
* <br/> - Available on Web only.
|
|
74
|
+
*/
|
|
75
|
+
marginBottom: number | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* The left margin of the area where subtitles are being rendered.
|
|
78
|
+
*
|
|
79
|
+
* @remarks
|
|
80
|
+
* <br/> - The margin is in number of pixels.
|
|
81
|
+
*/
|
|
82
|
+
marginLeft: number | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* The right margin of the area where subtitles are being rendered.
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
* <br/> - The margin is in number of pixels.
|
|
88
|
+
* <br/> - Useful for pushing the subtitles left, so they don't overlap with the UI.
|
|
89
|
+
* <br/> - Available on Web only.
|
|
90
|
+
*/
|
|
91
|
+
marginRight: number | undefined;
|
|
60
92
|
}
|
|
61
93
|
/**
|
|
62
94
|
* The style of the edge, represented by a value from the following list:
|
|
@@ -68,4 +100,10 @@ export interface TextTrackStyle {
|
|
|
68
100
|
*
|
|
69
101
|
* @public
|
|
70
102
|
*/
|
|
71
|
-
export declare
|
|
103
|
+
export declare enum EdgeStyle {
|
|
104
|
+
none = "none",
|
|
105
|
+
dropshadow = "dropshadow",
|
|
106
|
+
raised = "raised",
|
|
107
|
+
depressed = "depressed",
|
|
108
|
+
uniform = "uniform"
|
|
109
|
+
}
|
|
@@ -1,17 +1,35 @@
|
|
|
1
1
|
import type { EdgeStyle, TextTrackStyle, THEOplayerView } from 'react-native-theoplayer';
|
|
2
2
|
export declare class TextTrackStyleAdapter implements TextTrackStyle {
|
|
3
|
-
private readonly
|
|
4
|
-
|
|
3
|
+
private readonly _view;
|
|
4
|
+
private _backgroundColor;
|
|
5
|
+
private _edgeStyle;
|
|
6
|
+
private _fontColor;
|
|
7
|
+
private _fontFamily;
|
|
8
|
+
private _fontSize;
|
|
9
|
+
private _windowColor;
|
|
10
|
+
private _marginBottom;
|
|
11
|
+
private _marginTop;
|
|
12
|
+
private _marginLeft;
|
|
13
|
+
private _marginRight;
|
|
14
|
+
constructor(_view: THEOplayerView);
|
|
5
15
|
get backgroundColor(): string | undefined;
|
|
6
|
-
set backgroundColor(
|
|
16
|
+
set backgroundColor(color: string | undefined);
|
|
7
17
|
get edgeStyle(): EdgeStyle | undefined;
|
|
8
|
-
set edgeStyle(
|
|
18
|
+
set edgeStyle(style: EdgeStyle | undefined);
|
|
9
19
|
get fontColor(): string | undefined;
|
|
10
|
-
set fontColor(
|
|
20
|
+
set fontColor(color: string | undefined);
|
|
11
21
|
get fontFamily(): string | undefined;
|
|
12
|
-
set fontFamily(
|
|
22
|
+
set fontFamily(family: string | undefined);
|
|
13
23
|
get fontSize(): string | undefined;
|
|
14
|
-
set fontSize(
|
|
24
|
+
set fontSize(size: string | undefined);
|
|
15
25
|
get windowColor(): string | undefined;
|
|
16
|
-
set windowColor(
|
|
26
|
+
set windowColor(color: string | undefined);
|
|
27
|
+
get marginBottom(): number | undefined;
|
|
28
|
+
set marginBottom(margin: number | undefined);
|
|
29
|
+
get marginLeft(): number | undefined;
|
|
30
|
+
set marginLeft(margin: number | undefined);
|
|
31
|
+
get marginRight(): number | undefined;
|
|
32
|
+
set marginRight(margin: number | undefined);
|
|
33
|
+
get marginTop(): number | undefined;
|
|
34
|
+
set marginTop(margin: number | undefined);
|
|
17
35
|
}
|
package/package.json
CHANGED
|
@@ -36,7 +36,7 @@ Pod::Spec.new do |s|
|
|
|
36
36
|
}
|
|
37
37
|
else
|
|
38
38
|
puts "Using THEOplayer-core SDK"
|
|
39
|
-
s.dependency "THEOplayerSDK-core", "~> 5.
|
|
39
|
+
s.dependency "THEOplayerSDK-core", "~> 5.6"
|
|
40
40
|
if theofeatures.include?("GOOGLE_IMA")
|
|
41
41
|
puts "Adding THEOplayer-Integration-GoogleIMA"
|
|
42
42
|
s.dependency "THEOplayer-Integration-GoogleIMA"
|
|
@@ -15,7 +15,7 @@ export interface TextTrackStyle {
|
|
|
15
15
|
* @example
|
|
16
16
|
* <br/> - `red` will set the color of the text to red.
|
|
17
17
|
* <br/> - `#ff0000` will set the color of the text to red.
|
|
18
|
-
* <br/> - `rgba(255,0,0,0.5)` will set the color of the text to red, with 50% opacity.
|
|
18
|
+
* <br/> - Available on Web only: `rgba(255,0,0,0.5)` will set the color of the text to red, with 50% opacity.
|
|
19
19
|
*/
|
|
20
20
|
fontColor: string | undefined;
|
|
21
21
|
|
|
@@ -36,7 +36,7 @@ export interface TextTrackStyle {
|
|
|
36
36
|
* @example
|
|
37
37
|
* <br/> - `red` will set the background color of the text track to red.
|
|
38
38
|
* <br/> - `#ff0000` will set the background color of the text track to red.
|
|
39
|
-
* <br/> - `rgba(255,0,0,0.5)` will set the background color of the text track to red, with 50% opacity.
|
|
39
|
+
* <br/> - Available on Web only: `rgba(255,0,0,0.5)` will set the background color of the text track to red, with 50% opacity.
|
|
40
40
|
*/
|
|
41
41
|
backgroundColor: string | undefined;
|
|
42
42
|
|
|
@@ -44,12 +44,13 @@ export interface TextTrackStyle {
|
|
|
44
44
|
* The window color for the text track.
|
|
45
45
|
*
|
|
46
46
|
* @remarks
|
|
47
|
-
* This targets the area covering the full width of the text track.
|
|
47
|
+
* <br/> - This targets the area covering the full width of the text track.
|
|
48
|
+
* <br/> - Available on Web and Android only.
|
|
48
49
|
*
|
|
49
50
|
* @example
|
|
50
51
|
* <br/> - `red` will set the background color of the window of the text track to red.
|
|
51
52
|
* <br/> - `#ff0000` will set the background color of the window of the text track to red.
|
|
52
|
-
* <br/> - `rgba(255,0,0,0.5)` will set the background color of the window of the text track to red, with 50% opacity.
|
|
53
|
+
* <br/> - Available on Web only: `rgba(255,0,0,0.5)` will set the background color of the window of the text track to red, with 50% opacity.
|
|
53
54
|
*/
|
|
54
55
|
windowColor: string | undefined;
|
|
55
56
|
|
|
@@ -62,6 +63,39 @@ export interface TextTrackStyle {
|
|
|
62
63
|
* <br/> - `'uniform`
|
|
63
64
|
*/
|
|
64
65
|
edgeStyle: EdgeStyle | undefined;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The top margin of the area where subtitles are being rendered.
|
|
69
|
+
*
|
|
70
|
+
* @remarks
|
|
71
|
+
* <br/> - The margin is in number of pixels.
|
|
72
|
+
*/
|
|
73
|
+
marginTop: number | undefined;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The bottom margin of the area where subtitles are being rendered.
|
|
77
|
+
*
|
|
78
|
+
* @remarks
|
|
79
|
+
* <br/> - The margin is in number of pixels.
|
|
80
|
+
* <br/> - Available on Web only.
|
|
81
|
+
*/
|
|
82
|
+
marginBottom: number | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* The left margin of the area where subtitles are being rendered.
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
* <br/> - The margin is in number of pixels.
|
|
88
|
+
*/
|
|
89
|
+
marginLeft: number | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* The right margin of the area where subtitles are being rendered.
|
|
92
|
+
*
|
|
93
|
+
* @remarks
|
|
94
|
+
* <br/> - The margin is in number of pixels.
|
|
95
|
+
* <br/> - Useful for pushing the subtitles left, so they don't overlap with the UI.
|
|
96
|
+
* <br/> - Available on Web only.
|
|
97
|
+
*/
|
|
98
|
+
marginRight: number | undefined;
|
|
65
99
|
}
|
|
66
100
|
|
|
67
101
|
/**
|
|
@@ -74,4 +108,10 @@ export interface TextTrackStyle {
|
|
|
74
108
|
*
|
|
75
109
|
* @public
|
|
76
110
|
*/
|
|
77
|
-
export
|
|
111
|
+
export enum EdgeStyle {
|
|
112
|
+
none = 'none',
|
|
113
|
+
dropshadow = 'dropshadow',
|
|
114
|
+
raised = 'raised',
|
|
115
|
+
depressed = 'depressed',
|
|
116
|
+
uniform = 'uniform',
|
|
117
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
{
|
|
2
|
+
"aliceblue": "f0f8ff",
|
|
3
|
+
"antiquewhite": "faebd7",
|
|
4
|
+
"aqua": "00ffff",
|
|
5
|
+
"aquamarine": "7fffd4",
|
|
6
|
+
"azure": "f0ffff",
|
|
7
|
+
"beige": "f5f5dc",
|
|
8
|
+
"bisque": "ffe4c4",
|
|
9
|
+
"black": "000000",
|
|
10
|
+
"blanchedalmond": "ffebcd",
|
|
11
|
+
"blue": "0000ff",
|
|
12
|
+
"blueviolet": "8a2be2",
|
|
13
|
+
"brown": "a52a2a",
|
|
14
|
+
"burlywood": "deb887",
|
|
15
|
+
"cadetblue": "5f9ea0",
|
|
16
|
+
"chartreuse": "7fff00",
|
|
17
|
+
"chocolate": "d2691e",
|
|
18
|
+
"coral": "ff7f50",
|
|
19
|
+
"cornflowerblue": "6495ed",
|
|
20
|
+
"cornsilk": "fff8dc",
|
|
21
|
+
"crimson": "dc143c",
|
|
22
|
+
"cyan": "00ffff",
|
|
23
|
+
"darkblue": "00008b",
|
|
24
|
+
"darkcyan": "008b8b",
|
|
25
|
+
"darkgoldenrod": "b8860b",
|
|
26
|
+
"darkgray": "a9a9a9",
|
|
27
|
+
"darkgreen": "006400",
|
|
28
|
+
"darkkhaki": "bdb76b",
|
|
29
|
+
"darkmagenta": "8b008b",
|
|
30
|
+
"darkolivegreen": "556b2f",
|
|
31
|
+
"darkorange": "ff8c00",
|
|
32
|
+
"darkorchid": "9932cc",
|
|
33
|
+
"darkred": "8b0000",
|
|
34
|
+
"darksalmon": "e9967a",
|
|
35
|
+
"darkseagreen": "8fbc8f",
|
|
36
|
+
"darkslateblue": "483d8b",
|
|
37
|
+
"darkslategray": "2f4f4f",
|
|
38
|
+
"darkturquoise": "00ced1",
|
|
39
|
+
"darkviolet": "9400d3",
|
|
40
|
+
"deeppink": "ff1493",
|
|
41
|
+
"deepskyblue": "00bfff",
|
|
42
|
+
"dimgray": "696969",
|
|
43
|
+
"dodgerblue": "1e90ff",
|
|
44
|
+
"firebrick": "b22222",
|
|
45
|
+
"floralwhite": "fffaf0",
|
|
46
|
+
"forestgreen": "228b22",
|
|
47
|
+
"fuchsia": "ff00ff",
|
|
48
|
+
"gainsboro": "dcdcdc",
|
|
49
|
+
"ghostwhite": "f8f8ff",
|
|
50
|
+
"gold": "ffd700",
|
|
51
|
+
"goldenrod": "daa520",
|
|
52
|
+
"gray": "808080",
|
|
53
|
+
"green": "008000",
|
|
54
|
+
"greenyellow": "adff2f",
|
|
55
|
+
"honeydew": "f0fff0",
|
|
56
|
+
"hotpink": "ff69b4",
|
|
57
|
+
"indianred": "cd5c5c",
|
|
58
|
+
"indigo": "4b0082",
|
|
59
|
+
"ivory": "fffff0",
|
|
60
|
+
"khaki": "f0e68c",
|
|
61
|
+
"lavender": "e6e6fa",
|
|
62
|
+
"lavenderblush": "fff0f5",
|
|
63
|
+
"lawngreen": "7cfc00",
|
|
64
|
+
"lemonchiffon": "fffacd",
|
|
65
|
+
"lightblue": "add8e6",
|
|
66
|
+
"lightcoral": "f08080",
|
|
67
|
+
"lightcyan": "e0ffff",
|
|
68
|
+
"lightgoldenrodyellow": "fafad2",
|
|
69
|
+
"lightgray": "d3d3d3",
|
|
70
|
+
"lightgreen": "90ee90",
|
|
71
|
+
"lightpink": "ffb6c1",
|
|
72
|
+
"lightsalmon": "ffa07a",
|
|
73
|
+
"lightseagreen": "20b2aa",
|
|
74
|
+
"lightskyblue": "87cefa",
|
|
75
|
+
"lightslategray": "778899",
|
|
76
|
+
"lightsteelblue": "b0c4de",
|
|
77
|
+
"lightyellow": "ffffe0",
|
|
78
|
+
"lime": "00ff00",
|
|
79
|
+
"limegreen": "32cd32",
|
|
80
|
+
"linen": "faf0e6",
|
|
81
|
+
"magenta": "ff00ff",
|
|
82
|
+
"maroon": "800000",
|
|
83
|
+
"mediumaquamarine": "66cdaa",
|
|
84
|
+
"mediumblue": "0000cd",
|
|
85
|
+
"mediumorchid": "ba55d3",
|
|
86
|
+
"mediumpurple": "9370db",
|
|
87
|
+
"mediumseagreen": "3cb371",
|
|
88
|
+
"mediumslateblue": "7b68ee",
|
|
89
|
+
"mediumspringgreen": "00fa9a",
|
|
90
|
+
"mediumturquoise": "48d1cc",
|
|
91
|
+
"mediumvioletred": "c71585",
|
|
92
|
+
"midnightblue": "191970",
|
|
93
|
+
"mintcream": "f5fffa",
|
|
94
|
+
"mistyrose": "ffe4e1",
|
|
95
|
+
"moccasin": "ffe4b5",
|
|
96
|
+
"navajowhite": "ffdead",
|
|
97
|
+
"navy": "000080",
|
|
98
|
+
"oldlace": "fdf5e6",
|
|
99
|
+
"olive": "808000",
|
|
100
|
+
"olivedrab": "6b8e23",
|
|
101
|
+
"orange": "ffa500",
|
|
102
|
+
"orangered": "ff4500",
|
|
103
|
+
"orchid": "da70d6",
|
|
104
|
+
"palegoldenrod": "eee8aa",
|
|
105
|
+
"palegreen": "98fb98",
|
|
106
|
+
"paleturquoise": "afeeee",
|
|
107
|
+
"palevioletred": "db7093",
|
|
108
|
+
"papayawhip": "ffefd5",
|
|
109
|
+
"peachpuff": "ffdab9",
|
|
110
|
+
"peru": "cd853f",
|
|
111
|
+
"pink": "ffc0cb",
|
|
112
|
+
"plum": "dda0dd",
|
|
113
|
+
"powderblue": "b0e0e6",
|
|
114
|
+
"purple": "800080",
|
|
115
|
+
"rebeccapurple": "663399",
|
|
116
|
+
"red": "ff0000",
|
|
117
|
+
"rosybrown": "bc8f8f",
|
|
118
|
+
"royalblue": "4169e1",
|
|
119
|
+
"saddlebrown": "8b4513",
|
|
120
|
+
"salmon": "fa8072",
|
|
121
|
+
"sandybrown": "f4a460",
|
|
122
|
+
"seagreen": "2e8b57",
|
|
123
|
+
"seashell": "fff5ee",
|
|
124
|
+
"sienna": "a0522d",
|
|
125
|
+
"silver": "c0c0c0",
|
|
126
|
+
"skyblue": "87ceeb",
|
|
127
|
+
"slateblue": "6a5acd",
|
|
128
|
+
"slategray": "708090",
|
|
129
|
+
"snow": "fffafa",
|
|
130
|
+
"springgreen": "00ff7f",
|
|
131
|
+
"steelblue": "4682b4",
|
|
132
|
+
"tan": "d2b48c",
|
|
133
|
+
"teal": "008080",
|
|
134
|
+
"thistle": "d8bfd8",
|
|
135
|
+
"tomato": "ff6347",
|
|
136
|
+
"turquoise": "40e0d0",
|
|
137
|
+
"violet": "ee82ee",
|
|
138
|
+
"wheat": "f5deb3",
|
|
139
|
+
"white": "ffffff",
|
|
140
|
+
"whitesmoke": "f5f5f5",
|
|
141
|
+
"yellow": "ffff00",
|
|
142
|
+
"yellowgreen": "9acd32"
|
|
143
|
+
}
|