bitmovin-player-react-native 0.35.0 → 0.37.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/RNBitmovinPlayer.podspec +1 -1
- package/android/src/main/java/com/bitmovin/player/reactnative/MediaSessionPlaybackManager.kt +10 -5
- package/android/src/main/java/com/bitmovin/player/reactnative/PlayerModule.kt +1 -3
- package/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt +8 -0
- package/lib/index.d.mts +27 -1
- package/lib/index.d.ts +27 -1
- package/lib/index.js +7 -0
- package/lib/index.mjs +6 -0
- package/package.json +1 -1
- package/src/components/PlayerView/playerViewConfig.ts +28 -0
package/RNBitmovinPlayer.podspec
CHANGED
|
@@ -20,7 +20,7 @@ Pod::Spec.new do |s|
|
|
|
20
20
|
|
|
21
21
|
s.swift_version = "5.10"
|
|
22
22
|
s.dependency "React-Core"
|
|
23
|
-
s.dependency "BitmovinPlayer", "3.
|
|
23
|
+
s.dependency "BitmovinPlayer", "3.81.0"
|
|
24
24
|
s.ios.dependency "GoogleAds-IMA-iOS-SDK", "3.23.0"
|
|
25
25
|
s.tvos.dependency "GoogleAds-IMA-tvOS-SDK", "4.13.0"
|
|
26
26
|
end
|
package/android/src/main/java/com/bitmovin/player/reactnative/MediaSessionPlaybackManager.kt
CHANGED
|
@@ -12,7 +12,7 @@ import com.facebook.react.bridge.*
|
|
|
12
12
|
|
|
13
13
|
class MediaSessionPlaybackManager(val context: ReactApplicationContext) {
|
|
14
14
|
private var serviceBinder: MediaSessionPlaybackService.ServiceBinder? = null
|
|
15
|
-
private
|
|
15
|
+
private var playerId: NativeId? = null
|
|
16
16
|
val player: Player?
|
|
17
17
|
get() = serviceBinder?.player
|
|
18
18
|
|
|
@@ -24,7 +24,9 @@ class MediaSessionPlaybackManager(val context: ReactApplicationContext) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
override fun onServiceDisconnected(name: ComponentName) {
|
|
27
|
-
|
|
27
|
+
playerId?.let {
|
|
28
|
+
destroy(it)
|
|
29
|
+
}
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
|
|
@@ -38,13 +40,16 @@ class MediaSessionPlaybackManager(val context: ReactApplicationContext) {
|
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
fun destroy(nativeId: NativeId) {
|
|
41
|
-
if (nativeId != playerId) {
|
|
43
|
+
if (nativeId != playerId) {
|
|
44
|
+
return
|
|
45
|
+
}
|
|
42
46
|
serviceBinder?.player = null
|
|
43
47
|
serviceBinder = null
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
private fun getPlayer(
|
|
47
|
-
nativeId: NativeId = playerId,
|
|
51
|
+
nativeId: NativeId? = playerId,
|
|
48
52
|
playerModule: PlayerModule? = context.playerModule,
|
|
49
|
-
): Player = playerModule?.getPlayerOrNull(nativeId)
|
|
53
|
+
): Player = nativeId?.let { playerModule?.getPlayerOrNull(nativeId) }
|
|
54
|
+
?: throw IllegalArgumentException("Invalid PlayerId $nativeId")
|
|
50
55
|
}
|
|
@@ -97,9 +97,7 @@ class PlayerModule(context: ReactApplicationContext) : BitmovinBaseModule(contex
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
if (enableMediaSession) {
|
|
100
|
-
|
|
101
|
-
mediaSessionPlaybackManager.setupMediaSessionPlayback(nativeId)
|
|
102
|
-
}
|
|
100
|
+
mediaSessionPlaybackManager.setupMediaSessionPlayback(nativeId)
|
|
103
101
|
}
|
|
104
102
|
}
|
|
105
103
|
|
|
@@ -51,6 +51,7 @@ import com.bitmovin.player.api.source.TimelineReferencePoint
|
|
|
51
51
|
import com.bitmovin.player.api.ui.PlayerViewConfig
|
|
52
52
|
import com.bitmovin.player.api.ui.ScalingMode
|
|
53
53
|
import com.bitmovin.player.api.ui.StyleConfig
|
|
54
|
+
import com.bitmovin.player.api.ui.SurfaceType
|
|
54
55
|
import com.bitmovin.player.api.ui.UiConfig
|
|
55
56
|
import com.bitmovin.player.reactnative.BitmovinCastManagerOptions
|
|
56
57
|
import com.bitmovin.player.reactnative.PictureInPictureConfig
|
|
@@ -772,8 +773,15 @@ fun ReadableMap.toPictureInPictureConfig(): PictureInPictureConfig = PictureInPi
|
|
|
772
773
|
fun ReadableMap.toPlayerViewConfig(): PlayerViewConfig = PlayerViewConfig(
|
|
773
774
|
uiConfig = getMap("uiConfig")?.toUiConfig() ?: UiConfig.WebUi(),
|
|
774
775
|
hideFirstFrame = getBooleanOrNull("hideFirstFrame") ?: false,
|
|
776
|
+
surfaceType = getString("surfaceType")?.toSurfaceType() ?: SurfaceType.SurfaceView,
|
|
775
777
|
)
|
|
776
778
|
|
|
779
|
+
private fun String.toSurfaceType(): SurfaceType? = when (this) {
|
|
780
|
+
"SurfaceView" -> SurfaceType.SurfaceView
|
|
781
|
+
"TextureView" -> SurfaceType.TextureView
|
|
782
|
+
else -> null
|
|
783
|
+
}
|
|
784
|
+
|
|
777
785
|
private fun ReadableMap.toUiConfig(): UiConfig {
|
|
778
786
|
val variant = toVariant() ?: UiConfig.WebUi.Variant.SmallScreenUi
|
|
779
787
|
val focusUiOnInitialization = getBooleanOrNull("focusUiOnInitialization")
|
package/lib/index.d.mts
CHANGED
|
@@ -3801,6 +3801,17 @@ interface PlayerViewConfig {
|
|
|
3801
3801
|
* To reliably hide the first frame before a pre-roll ad, please ensure that you are using the {@link AdvertisingConfig} to schedule ads and not the {@link Player.scheduleAd} API call.
|
|
3802
3802
|
*/
|
|
3803
3803
|
hideFirstFrame?: boolean;
|
|
3804
|
+
/**
|
|
3805
|
+
* Specify on which surface type the video should be rendered.
|
|
3806
|
+
*
|
|
3807
|
+
* See {@link https://developer.android.com/guide/topics/media/ui/playerview#surfacetype|Choosing a surface type}
|
|
3808
|
+
* for more information.
|
|
3809
|
+
*
|
|
3810
|
+
* Default is {@link SurfaceType.SurfaceView}.
|
|
3811
|
+
*
|
|
3812
|
+
* @platform Android
|
|
3813
|
+
*/
|
|
3814
|
+
surfaceType?: SurfaceType;
|
|
3804
3815
|
}
|
|
3805
3816
|
/**
|
|
3806
3817
|
* Configures the visual presentation and behaviour of the Bitmovin Player UI.
|
|
@@ -3861,6 +3872,21 @@ declare class TvUi extends Variant {
|
|
|
3861
3872
|
declare class CustomUi extends Variant {
|
|
3862
3873
|
constructor(uiManagerFactoryFunction: string);
|
|
3863
3874
|
}
|
|
3875
|
+
/**
|
|
3876
|
+
* The type of surface on which to render video.
|
|
3877
|
+
*
|
|
3878
|
+
* See {@link https://developer.android.com/guide/topics/media/ui/playerview#surfacetype|Choosing a surface type}
|
|
3879
|
+
* for more information.
|
|
3880
|
+
*/
|
|
3881
|
+
declare enum SurfaceType {
|
|
3882
|
+
/**
|
|
3883
|
+
* SurfaceView generally causes lower battery consumption,
|
|
3884
|
+
* and has better handling for HDR and secure content.
|
|
3885
|
+
*/
|
|
3886
|
+
SurfaceView = "SurfaceView",
|
|
3887
|
+
/** TextureView is sometime needed for smooth animations. */
|
|
3888
|
+
TextureView = "TextureView"
|
|
3889
|
+
}
|
|
3864
3890
|
|
|
3865
3891
|
/**
|
|
3866
3892
|
* Base `PlayerView` component props.
|
|
@@ -4079,4 +4105,4 @@ declare class DebugConfig {
|
|
|
4079
4105
|
static setDebugLoggingEnabled(value: boolean): Promise<void>;
|
|
4080
4106
|
}
|
|
4081
4107
|
|
|
4082
|
-
export { Ad, AdBreak, AdBreakFinishedEvent, AdBreakStartedEvent, AdClickedEvent, AdConfig, AdData, AdErrorEvent, AdFinishedEvent, AdItem, AdManifestLoadEvent, AdManifestLoadedEvent, AdQuartile, AdQuartileEvent, AdScheduledEvent, AdSkippedEvent, AdSource, AdSourceType, AdStartedEvent, AdaptationConfig, AdvertisingConfig, AnalyticsApi, AnalyticsConfig, AudioAddedEvent, AudioChangedEvent, AudioRemovedEvent, AudioSession, AudioSessionCategory, AudioTrack, BasePlayerViewProps, BitmovinCastManager, BitmovinCastManagerOptions, BitmovinNativeOfflineEventData, BufferApi, BufferConfig, BufferLevel, BufferLevels, BufferMediaTypeConfig, BufferType, CastAvailableEvent, CastPausedEvent, CastPayload, CastPlaybackFinishedEvent, CastPlayingEvent, CastStartEvent, CastStartedEvent, CastStoppedEvent, CastTimeUpdatedEvent, CastWaitingForDeviceEvent, CueEnterEvent, CueExitEvent, CustomDataConfig, CustomMessageHandler, CustomMessageHandlerProps, CustomUi, DebugConfig, DefaultMetadata, DestroyEvent, DownloadFinishedEvent, Drm, DrmConfig, ErrorEvent, Event, EventSource, FairplayConfig, ForceReuseVideoCodecReason, FullscreenDisabledEvent, FullscreenEnabledEvent, FullscreenEnterEvent, FullscreenExitEvent, FullscreenHandler, HttpRequest, HttpRequestType, HttpResponse, LiveConfig, LoadingState, MediaControlConfig, MediaType, MutedEvent, Network, NetworkConfig, OfflineContentConfig, OfflineContentManager, OfflineContentManagerListener, OfflineContentOptionEntry, OfflineContentOptions, OfflineDownloadRequest, OfflineEvent, OfflineEventType, OfflineSourceOptions, OfflineState, OnCanceledEvent, OnCompletedEvent, OnDrmLicenseExpiredEvent, OnDrmLicenseUpdatedEvent, OnErrorEvent, OnOptionsAvailableEvent, OnProgressEvent, OnResumedEvent, OnSuspendedEvent, PausedEvent, PictureInPictureAvailabilityChangedEvent, PictureInPictureConfig, PictureInPictureEnterEvent, PictureInPictureEnteredEvent, PictureInPictureExitEvent, PictureInPictureExitedEvent, PlayEvent, PlaybackConfig, PlaybackFinishedEvent, PlaybackSpeedChangedEvent, Player, PlayerActiveEvent, PlayerConfig, PlayerErrorEvent, PlayerView, PlayerViewConfig, PlayerViewProps, PlayerWarningEvent, PlayingEvent, ReadyEvent, RemoteControlConfig, ScalingMode, SeekEvent, SeekPosition, SeekedEvent, SideLoadedSubtitleTrack, SmallScreenUi, Source, SourceConfig, SourceErrorEvent, SourceLoadEvent, SourceLoadedEvent, SourceMetadata, SourceOptions, SourceRemoteControlConfig, SourceType, SourceUnloadedEvent, SourceWarningEvent, StallEndedEvent, StallStartedEvent, StyleConfig, SubtitleAddedEvent, SubtitleChangedEvent, SubtitleFormat, SubtitleRemovedEvent, SubtitleTrack, Thumbnail, TimeChangedEvent, TimeShiftEvent, TimeShiftedEvent, TimelineReferencePoint, TvUi, TweaksConfig, UiConfig, UnmutedEvent, UserInterfaceType, Variant, VideoDownloadQualityChangedEvent, VideoPlaybackQualityChangedEvent, VideoQuality, WebUiConfig, WidevineConfig, usePlayer };
|
|
4108
|
+
export { Ad, AdBreak, AdBreakFinishedEvent, AdBreakStartedEvent, AdClickedEvent, AdConfig, AdData, AdErrorEvent, AdFinishedEvent, AdItem, AdManifestLoadEvent, AdManifestLoadedEvent, AdQuartile, AdQuartileEvent, AdScheduledEvent, AdSkippedEvent, AdSource, AdSourceType, AdStartedEvent, AdaptationConfig, AdvertisingConfig, AnalyticsApi, AnalyticsConfig, AudioAddedEvent, AudioChangedEvent, AudioRemovedEvent, AudioSession, AudioSessionCategory, AudioTrack, BasePlayerViewProps, BitmovinCastManager, BitmovinCastManagerOptions, BitmovinNativeOfflineEventData, BufferApi, BufferConfig, BufferLevel, BufferLevels, BufferMediaTypeConfig, BufferType, CastAvailableEvent, CastPausedEvent, CastPayload, CastPlaybackFinishedEvent, CastPlayingEvent, CastStartEvent, CastStartedEvent, CastStoppedEvent, CastTimeUpdatedEvent, CastWaitingForDeviceEvent, CueEnterEvent, CueExitEvent, CustomDataConfig, CustomMessageHandler, CustomMessageHandlerProps, CustomUi, DebugConfig, DefaultMetadata, DestroyEvent, DownloadFinishedEvent, Drm, DrmConfig, ErrorEvent, Event, EventSource, FairplayConfig, ForceReuseVideoCodecReason, FullscreenDisabledEvent, FullscreenEnabledEvent, FullscreenEnterEvent, FullscreenExitEvent, FullscreenHandler, HttpRequest, HttpRequestType, HttpResponse, LiveConfig, LoadingState, MediaControlConfig, MediaType, MutedEvent, Network, NetworkConfig, OfflineContentConfig, OfflineContentManager, OfflineContentManagerListener, OfflineContentOptionEntry, OfflineContentOptions, OfflineDownloadRequest, OfflineEvent, OfflineEventType, OfflineSourceOptions, OfflineState, OnCanceledEvent, OnCompletedEvent, OnDrmLicenseExpiredEvent, OnDrmLicenseUpdatedEvent, OnErrorEvent, OnOptionsAvailableEvent, OnProgressEvent, OnResumedEvent, OnSuspendedEvent, PausedEvent, PictureInPictureAvailabilityChangedEvent, PictureInPictureConfig, PictureInPictureEnterEvent, PictureInPictureEnteredEvent, PictureInPictureExitEvent, PictureInPictureExitedEvent, PlayEvent, PlaybackConfig, PlaybackFinishedEvent, PlaybackSpeedChangedEvent, Player, PlayerActiveEvent, PlayerConfig, PlayerErrorEvent, PlayerView, PlayerViewConfig, PlayerViewProps, PlayerWarningEvent, PlayingEvent, ReadyEvent, RemoteControlConfig, ScalingMode, SeekEvent, SeekPosition, SeekedEvent, SideLoadedSubtitleTrack, SmallScreenUi, Source, SourceConfig, SourceErrorEvent, SourceLoadEvent, SourceLoadedEvent, SourceMetadata, SourceOptions, SourceRemoteControlConfig, SourceType, SourceUnloadedEvent, SourceWarningEvent, StallEndedEvent, StallStartedEvent, StyleConfig, SubtitleAddedEvent, SubtitleChangedEvent, SubtitleFormat, SubtitleRemovedEvent, SubtitleTrack, SurfaceType, Thumbnail, TimeChangedEvent, TimeShiftEvent, TimeShiftedEvent, TimelineReferencePoint, TvUi, TweaksConfig, UiConfig, UnmutedEvent, UserInterfaceType, Variant, VideoDownloadQualityChangedEvent, VideoPlaybackQualityChangedEvent, VideoQuality, WebUiConfig, WidevineConfig, usePlayer };
|
package/lib/index.d.ts
CHANGED
|
@@ -3801,6 +3801,17 @@ interface PlayerViewConfig {
|
|
|
3801
3801
|
* To reliably hide the first frame before a pre-roll ad, please ensure that you are using the {@link AdvertisingConfig} to schedule ads and not the {@link Player.scheduleAd} API call.
|
|
3802
3802
|
*/
|
|
3803
3803
|
hideFirstFrame?: boolean;
|
|
3804
|
+
/**
|
|
3805
|
+
* Specify on which surface type the video should be rendered.
|
|
3806
|
+
*
|
|
3807
|
+
* See {@link https://developer.android.com/guide/topics/media/ui/playerview#surfacetype|Choosing a surface type}
|
|
3808
|
+
* for more information.
|
|
3809
|
+
*
|
|
3810
|
+
* Default is {@link SurfaceType.SurfaceView}.
|
|
3811
|
+
*
|
|
3812
|
+
* @platform Android
|
|
3813
|
+
*/
|
|
3814
|
+
surfaceType?: SurfaceType;
|
|
3804
3815
|
}
|
|
3805
3816
|
/**
|
|
3806
3817
|
* Configures the visual presentation and behaviour of the Bitmovin Player UI.
|
|
@@ -3861,6 +3872,21 @@ declare class TvUi extends Variant {
|
|
|
3861
3872
|
declare class CustomUi extends Variant {
|
|
3862
3873
|
constructor(uiManagerFactoryFunction: string);
|
|
3863
3874
|
}
|
|
3875
|
+
/**
|
|
3876
|
+
* The type of surface on which to render video.
|
|
3877
|
+
*
|
|
3878
|
+
* See {@link https://developer.android.com/guide/topics/media/ui/playerview#surfacetype|Choosing a surface type}
|
|
3879
|
+
* for more information.
|
|
3880
|
+
*/
|
|
3881
|
+
declare enum SurfaceType {
|
|
3882
|
+
/**
|
|
3883
|
+
* SurfaceView generally causes lower battery consumption,
|
|
3884
|
+
* and has better handling for HDR and secure content.
|
|
3885
|
+
*/
|
|
3886
|
+
SurfaceView = "SurfaceView",
|
|
3887
|
+
/** TextureView is sometime needed for smooth animations. */
|
|
3888
|
+
TextureView = "TextureView"
|
|
3889
|
+
}
|
|
3864
3890
|
|
|
3865
3891
|
/**
|
|
3866
3892
|
* Base `PlayerView` component props.
|
|
@@ -4079,4 +4105,4 @@ declare class DebugConfig {
|
|
|
4079
4105
|
static setDebugLoggingEnabled(value: boolean): Promise<void>;
|
|
4080
4106
|
}
|
|
4081
4107
|
|
|
4082
|
-
export { Ad, AdBreak, AdBreakFinishedEvent, AdBreakStartedEvent, AdClickedEvent, AdConfig, AdData, AdErrorEvent, AdFinishedEvent, AdItem, AdManifestLoadEvent, AdManifestLoadedEvent, AdQuartile, AdQuartileEvent, AdScheduledEvent, AdSkippedEvent, AdSource, AdSourceType, AdStartedEvent, AdaptationConfig, AdvertisingConfig, AnalyticsApi, AnalyticsConfig, AudioAddedEvent, AudioChangedEvent, AudioRemovedEvent, AudioSession, AudioSessionCategory, AudioTrack, BasePlayerViewProps, BitmovinCastManager, BitmovinCastManagerOptions, BitmovinNativeOfflineEventData, BufferApi, BufferConfig, BufferLevel, BufferLevels, BufferMediaTypeConfig, BufferType, CastAvailableEvent, CastPausedEvent, CastPayload, CastPlaybackFinishedEvent, CastPlayingEvent, CastStartEvent, CastStartedEvent, CastStoppedEvent, CastTimeUpdatedEvent, CastWaitingForDeviceEvent, CueEnterEvent, CueExitEvent, CustomDataConfig, CustomMessageHandler, CustomMessageHandlerProps, CustomUi, DebugConfig, DefaultMetadata, DestroyEvent, DownloadFinishedEvent, Drm, DrmConfig, ErrorEvent, Event, EventSource, FairplayConfig, ForceReuseVideoCodecReason, FullscreenDisabledEvent, FullscreenEnabledEvent, FullscreenEnterEvent, FullscreenExitEvent, FullscreenHandler, HttpRequest, HttpRequestType, HttpResponse, LiveConfig, LoadingState, MediaControlConfig, MediaType, MutedEvent, Network, NetworkConfig, OfflineContentConfig, OfflineContentManager, OfflineContentManagerListener, OfflineContentOptionEntry, OfflineContentOptions, OfflineDownloadRequest, OfflineEvent, OfflineEventType, OfflineSourceOptions, OfflineState, OnCanceledEvent, OnCompletedEvent, OnDrmLicenseExpiredEvent, OnDrmLicenseUpdatedEvent, OnErrorEvent, OnOptionsAvailableEvent, OnProgressEvent, OnResumedEvent, OnSuspendedEvent, PausedEvent, PictureInPictureAvailabilityChangedEvent, PictureInPictureConfig, PictureInPictureEnterEvent, PictureInPictureEnteredEvent, PictureInPictureExitEvent, PictureInPictureExitedEvent, PlayEvent, PlaybackConfig, PlaybackFinishedEvent, PlaybackSpeedChangedEvent, Player, PlayerActiveEvent, PlayerConfig, PlayerErrorEvent, PlayerView, PlayerViewConfig, PlayerViewProps, PlayerWarningEvent, PlayingEvent, ReadyEvent, RemoteControlConfig, ScalingMode, SeekEvent, SeekPosition, SeekedEvent, SideLoadedSubtitleTrack, SmallScreenUi, Source, SourceConfig, SourceErrorEvent, SourceLoadEvent, SourceLoadedEvent, SourceMetadata, SourceOptions, SourceRemoteControlConfig, SourceType, SourceUnloadedEvent, SourceWarningEvent, StallEndedEvent, StallStartedEvent, StyleConfig, SubtitleAddedEvent, SubtitleChangedEvent, SubtitleFormat, SubtitleRemovedEvent, SubtitleTrack, Thumbnail, TimeChangedEvent, TimeShiftEvent, TimeShiftedEvent, TimelineReferencePoint, TvUi, TweaksConfig, UiConfig, UnmutedEvent, UserInterfaceType, Variant, VideoDownloadQualityChangedEvent, VideoPlaybackQualityChangedEvent, VideoQuality, WebUiConfig, WidevineConfig, usePlayer };
|
|
4108
|
+
export { Ad, AdBreak, AdBreakFinishedEvent, AdBreakStartedEvent, AdClickedEvent, AdConfig, AdData, AdErrorEvent, AdFinishedEvent, AdItem, AdManifestLoadEvent, AdManifestLoadedEvent, AdQuartile, AdQuartileEvent, AdScheduledEvent, AdSkippedEvent, AdSource, AdSourceType, AdStartedEvent, AdaptationConfig, AdvertisingConfig, AnalyticsApi, AnalyticsConfig, AudioAddedEvent, AudioChangedEvent, AudioRemovedEvent, AudioSession, AudioSessionCategory, AudioTrack, BasePlayerViewProps, BitmovinCastManager, BitmovinCastManagerOptions, BitmovinNativeOfflineEventData, BufferApi, BufferConfig, BufferLevel, BufferLevels, BufferMediaTypeConfig, BufferType, CastAvailableEvent, CastPausedEvent, CastPayload, CastPlaybackFinishedEvent, CastPlayingEvent, CastStartEvent, CastStartedEvent, CastStoppedEvent, CastTimeUpdatedEvent, CastWaitingForDeviceEvent, CueEnterEvent, CueExitEvent, CustomDataConfig, CustomMessageHandler, CustomMessageHandlerProps, CustomUi, DebugConfig, DefaultMetadata, DestroyEvent, DownloadFinishedEvent, Drm, DrmConfig, ErrorEvent, Event, EventSource, FairplayConfig, ForceReuseVideoCodecReason, FullscreenDisabledEvent, FullscreenEnabledEvent, FullscreenEnterEvent, FullscreenExitEvent, FullscreenHandler, HttpRequest, HttpRequestType, HttpResponse, LiveConfig, LoadingState, MediaControlConfig, MediaType, MutedEvent, Network, NetworkConfig, OfflineContentConfig, OfflineContentManager, OfflineContentManagerListener, OfflineContentOptionEntry, OfflineContentOptions, OfflineDownloadRequest, OfflineEvent, OfflineEventType, OfflineSourceOptions, OfflineState, OnCanceledEvent, OnCompletedEvent, OnDrmLicenseExpiredEvent, OnDrmLicenseUpdatedEvent, OnErrorEvent, OnOptionsAvailableEvent, OnProgressEvent, OnResumedEvent, OnSuspendedEvent, PausedEvent, PictureInPictureAvailabilityChangedEvent, PictureInPictureConfig, PictureInPictureEnterEvent, PictureInPictureEnteredEvent, PictureInPictureExitEvent, PictureInPictureExitedEvent, PlayEvent, PlaybackConfig, PlaybackFinishedEvent, PlaybackSpeedChangedEvent, Player, PlayerActiveEvent, PlayerConfig, PlayerErrorEvent, PlayerView, PlayerViewConfig, PlayerViewProps, PlayerWarningEvent, PlayingEvent, ReadyEvent, RemoteControlConfig, ScalingMode, SeekEvent, SeekPosition, SeekedEvent, SideLoadedSubtitleTrack, SmallScreenUi, Source, SourceConfig, SourceErrorEvent, SourceLoadEvent, SourceLoadedEvent, SourceMetadata, SourceOptions, SourceRemoteControlConfig, SourceType, SourceUnloadedEvent, SourceWarningEvent, StallEndedEvent, StallStartedEvent, StyleConfig, SubtitleAddedEvent, SubtitleChangedEvent, SubtitleFormat, SubtitleRemovedEvent, SubtitleTrack, SurfaceType, Thumbnail, TimeChangedEvent, TimeShiftEvent, TimeShiftedEvent, TimelineReferencePoint, TvUi, TweaksConfig, UiConfig, UnmutedEvent, UserInterfaceType, Variant, VideoDownloadQualityChangedEvent, VideoPlaybackQualityChangedEvent, VideoQuality, WebUiConfig, WidevineConfig, usePlayer };
|
package/lib/index.js
CHANGED
|
@@ -61,6 +61,7 @@ __export(src_exports, {
|
|
|
61
61
|
Source: () => Source,
|
|
62
62
|
SourceType: () => SourceType,
|
|
63
63
|
SubtitleFormat: () => SubtitleFormat,
|
|
64
|
+
SurfaceType: () => SurfaceType,
|
|
64
65
|
TimelineReferencePoint: () => TimelineReferencePoint,
|
|
65
66
|
TvUi: () => TvUi,
|
|
66
67
|
UserInterfaceType: () => UserInterfaceType,
|
|
@@ -498,6 +499,11 @@ var CustomUi = class extends Variant {
|
|
|
498
499
|
super(uiManagerFactoryFunction);
|
|
499
500
|
}
|
|
500
501
|
};
|
|
502
|
+
var SurfaceType = /* @__PURE__ */ ((SurfaceType2) => {
|
|
503
|
+
SurfaceType2["SurfaceView"] = "SurfaceView";
|
|
504
|
+
SurfaceType2["TextureView"] = "TextureView";
|
|
505
|
+
return SurfaceType2;
|
|
506
|
+
})(SurfaceType || {});
|
|
501
507
|
|
|
502
508
|
// src/drm/index.ts
|
|
503
509
|
var import_react_native9 = require("react-native");
|
|
@@ -1803,6 +1809,7 @@ var DebugConfig = _DebugConfig;
|
|
|
1803
1809
|
Source,
|
|
1804
1810
|
SourceType,
|
|
1805
1811
|
SubtitleFormat,
|
|
1812
|
+
SurfaceType,
|
|
1806
1813
|
TimelineReferencePoint,
|
|
1807
1814
|
TvUi,
|
|
1808
1815
|
UserInterfaceType,
|
package/lib/index.mjs
CHANGED
|
@@ -439,6 +439,11 @@ var CustomUi = class extends Variant {
|
|
|
439
439
|
super(uiManagerFactoryFunction);
|
|
440
440
|
}
|
|
441
441
|
};
|
|
442
|
+
var SurfaceType = /* @__PURE__ */ ((SurfaceType2) => {
|
|
443
|
+
SurfaceType2["SurfaceView"] = "SurfaceView";
|
|
444
|
+
SurfaceType2["TextureView"] = "TextureView";
|
|
445
|
+
return SurfaceType2;
|
|
446
|
+
})(SurfaceType || {});
|
|
442
447
|
|
|
443
448
|
// src/drm/index.ts
|
|
444
449
|
import { NativeModules as NativeModules6, Platform as Platform2 } from "react-native";
|
|
@@ -1746,6 +1751,7 @@ export {
|
|
|
1746
1751
|
Source,
|
|
1747
1752
|
SourceType,
|
|
1748
1753
|
SubtitleFormat,
|
|
1754
|
+
SurfaceType,
|
|
1749
1755
|
TimelineReferencePoint,
|
|
1750
1756
|
TvUi,
|
|
1751
1757
|
UserInterfaceType,
|
package/package.json
CHANGED
|
@@ -27,6 +27,18 @@ export interface PlayerViewConfig {
|
|
|
27
27
|
* To reliably hide the first frame before a pre-roll ad, please ensure that you are using the {@link AdvertisingConfig} to schedule ads and not the {@link Player.scheduleAd} API call.
|
|
28
28
|
*/
|
|
29
29
|
hideFirstFrame?: boolean;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Specify on which surface type the video should be rendered.
|
|
33
|
+
*
|
|
34
|
+
* See {@link https://developer.android.com/guide/topics/media/ui/playerview#surfacetype|Choosing a surface type}
|
|
35
|
+
* for more information.
|
|
36
|
+
*
|
|
37
|
+
* Default is {@link SurfaceType.SurfaceView}.
|
|
38
|
+
*
|
|
39
|
+
* @platform Android
|
|
40
|
+
*/
|
|
41
|
+
surfaceType?: SurfaceType;
|
|
30
42
|
}
|
|
31
43
|
|
|
32
44
|
/**
|
|
@@ -97,3 +109,19 @@ export class CustomUi extends Variant {
|
|
|
97
109
|
super(uiManagerFactoryFunction);
|
|
98
110
|
}
|
|
99
111
|
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The type of surface on which to render video.
|
|
115
|
+
*
|
|
116
|
+
* See {@link https://developer.android.com/guide/topics/media/ui/playerview#surfacetype|Choosing a surface type}
|
|
117
|
+
* for more information.
|
|
118
|
+
*/
|
|
119
|
+
export enum SurfaceType {
|
|
120
|
+
/**
|
|
121
|
+
* SurfaceView generally causes lower battery consumption,
|
|
122
|
+
* and has better handling for HDR and secure content.
|
|
123
|
+
*/
|
|
124
|
+
SurfaceView = 'SurfaceView',
|
|
125
|
+
/** TextureView is sometime needed for smooth animations. */
|
|
126
|
+
TextureView = 'TextureView',
|
|
127
|
+
}
|