Package com.castlabs.android.player
Class PlayerConfig
- java.lang.Object
-
- com.castlabs.android.player.PlayerConfig
-
- All Implemented Interfaces:
Parcelable
public class PlayerConfig extends Object implements Parcelable
Object which represents a specific Player configuration.You can use a
PlayerConfig
object to start playback on aPlayerController
calling itsPlayerController.open(PlayerConfig)
method.An instance can be built with the
PlayerConfig.Builder
. TheBuilder
can be populated with an already existingPlayerConfig
or with aBundle
.It is possible to convert an instance of
PlayerConfig
toBundle()
. ThisBundle
can also be used toPlayerController.open(Bundle)
thePlayerController
.This class is
Parcelable
.- Since:
- 4.2.1
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PlayerConfig.Builder
A Builder forPlayerConfig
.-
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description AbrConfiguration
abrConfiguration
The initial video qualityAdRequest
adRequest
The Ad request (if any)AdSchedule
adSchedule
Describes a custom ad schedule.boolean
allowHlsChunklessPreparation
If set to true, chunk-less preparation of hls tracks are allowedAnalyticsMetaData
analyticsMetaData
The analytics meta-dataint
analyticsSessionType
Analytics session typeAudioAttributes
audioAttributes
The Audio Attributes.boolean
audioDecoderFallback
If true (default), allows the player to fallback to other decoders if it failed to initialize the primary decoder.int
audioTrackGroupIndex
The index of the selected audio track groupint
audioTrackIndex
The index of the selected audio trackboolean
autoPlay
Whether to autoplay or notBufferConfiguration
bufferConfiguration
The buffer configurationCasConfiguration
casConfiguration
Cas configuration (if any)boolean
clipPeriods
If true then media periods will be clipped to their durations (currently is only applicable for DASH streams)long
clippingEndUs
The clipping end position in microsecondslong
clippingStartUs
The clipping start position in microsecondsString
configurationUrl
Optional configuration backend urlBundle
contentParameters
Header params to add to content (manifest) requestsBundle
contentQueryParameters
Query params to add to content (manifest) requestsint
contentType
The content formatString
contentUrl
Playback urlstatic Parcelable.Creator<PlayerConfig>
CREATOR
String
downloadFolder
Download folder in case the content is played offlineDrmConfiguration
drmConfiguration
Drm configuration (if any)boolean
enableAdSpeedUp
The flag to enable or disable automatic setting of a speed to 1x when playing ads.boolean
enableDashEventCallback
Enable internal handling of DASH event callbacksboolean
enableLooping
If set to true then the playback looping will be enabled and the player will automatically restart the playback after reaching end of contentboolean
enableTrickplayMode
Enable Trickplay mode at the start of the playback.boolean
enableTunneling
Enable tunneling supportboolean
enableTunnelingWithoutAudio
Force using of tunneling when audio track is disabled.boolean
enableWorkaroundEveryVideoFrameIsSyncFrame
If True, the workaround will be enabled to not treat the video frames as sync frames except the very first one.boolean
forceInStreamDrmInitData
If true then DRM init data from segments will be used instead of the one from manifest (currently is only applicable for DASH streams)String
id
ID for this contentstatic String
INTENT_CONFIGURATION_ID
A unique ID for the configurationstatic String
INTENT_CONFIGURATION_URL
Intent key to specify an optional URL to an API endpoint that can be used to refresh the configuration.static String
INTENT_LIVE
Indicates live contentstatic String
INTENT_METADATA
Additional Bundle-formatted meta-data such as poster images, titles, byline and any custom meta-datastatic String
INTENT_PREFERRED_CODEC_INFOS
Preferred media codec infosstatic String
INTENT_THREESIXTY
Indicates 360 degree contentboolean
live
Content live or VoDLiveConfiguration
liveConfiguration
The Live configurationboolean
mergeVideoTracks
If True, the video tracks will be merged into a single video trackBundle
metaData
Optional metadataNetworkConfiguration
networkConfiguration
The network configurationboolean
pauseOnHdmiDisconnected
Enable or disable automatic pausing on HDMI disconnectedlong
positionUs
The position in microseconds.String
preferredAudioLanguage
Preferred audio languageList<MediaCodecInfo>
preferredCodecInfos
String
preferredTextLanguage
Preferred subtitles languageboolean
preservePlayerViewSurface
If set to true and thePlayerView
is used, the playback surface be kept on screen and preserved when the player player is released.boolean
pushBlackScreenOnDispose
If true, indicates if the decoder should push a black screen to the surface when disposed.boolean
restoreSpeed
The flag to enable or disable automatic restoring of a speed after playing ads.Bundle
segmentParameters
Header params to add to segment requestsBundle
segmentQueryParameters
Query params to add to segment requestsList<SideloadedTrack>
sideloadedTracks
Array of side-loaded tracks, either subtitles or thumbnailsint
subtitlesTrackGroupIndex
The index of the selected subtitle track group or -1 for if subtitles are disabledint
subtitlesTrackIndex
The index of the selected subtitle track or -1 for if subtitles are disabledboolean
threesixty
360 supportTrickplayConfiguration
trickplayConfiguration
The Trickplay configurationboolean
unsecureDecoderFallback
If true (default), allows the player to fallback to unsecure decoders if it failed to initialize the primary decoder.boolean
useEth0
A boolean flag to indicate to use eth0 for multicast receptionString
userID
User ID.boolean
useStandaloneMediaClock
If set to true, will use Exoplayer'sStandaloneMediaClock
instead of the Renderer Clock.int
videoCodecFilter
The video codec filterboolean
videoDecoderFallback
If true (default), allows the player to fallback to other decoders if it failed to initialize the primary decoder.VideoFilterConfiguration
videoFilterConfiguration
The video filter configurationPoint
videoSizeFilter
Deprecated.UseVideoFilterConfiguration.maxPixel
instead.int
videoTrackGroupIndex
The index of the selected video track groupfloat
volume
The audio track volume-
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PlayerConfig.Builder
buildUpon()
Set theBuilder
values to the stored values in theBundle
.int
describeContents()
boolean
equals(Object obj)
static int
guessFormat(String url)
Guess the format of the or returnSdkConsts.CONTENT_TYPE_UNKNOWN
.int
hashCode()
void
save(Bundle bundle)
Saves the current configuration into aBundle
.Bundle
toBundle()
Obtain aBundle
filled with key-value pairs representing the current configuration.void
writeToParcel(Parcel dest, int flags)
-
-
-
Field Detail
-
INTENT_CONFIGURATION_URL
public static final String INTENT_CONFIGURATION_URL
Intent key to specify an optional URL to an API endpoint that can be used to refresh the configuration.This is intended only informative purposes, no actual refreshing will be performed by the SDK.
- See Also:
- Constant Field Values
-
INTENT_CONFIGURATION_ID
public static final String INTENT_CONFIGURATION_ID
A unique ID for the configuration- See Also:
- Constant Field Values
-
INTENT_LIVE
public static final String INTENT_LIVE
Indicates live content- See Also:
- Constant Field Values
-
INTENT_THREESIXTY
public static final String INTENT_THREESIXTY
Indicates 360 degree content- See Also:
- Constant Field Values
-
INTENT_METADATA
public static final String INTENT_METADATA
Additional Bundle-formatted meta-data such as poster images, titles, byline and any custom meta-data- See Also:
- Constant Field Values
-
INTENT_PREFERRED_CODEC_INFOS
public static final String INTENT_PREFERRED_CODEC_INFOS
Preferred media codec infos- See Also:
- Constant Field Values
-
positionUs
public final long positionUs
The position in microseconds. If set,LiveConfiguration.liveEdgeLatencyMs
will be ignored. If there's anInitialPositionProvider
, it will take precedence over this setting.
-
clippingStartUs
public final long clippingStartUs
The clipping start position in microseconds
-
clippingEndUs
public final long clippingEndUs
The clipping end position in microseconds
-
subtitlesTrackGroupIndex
public final int subtitlesTrackGroupIndex
The index of the selected subtitle track group or -1 for if subtitles are disabled
-
subtitlesTrackIndex
public final int subtitlesTrackIndex
The index of the selected subtitle track or -1 for if subtitles are disabled
-
audioTrackGroupIndex
public final int audioTrackGroupIndex
The index of the selected audio track group
-
audioTrackIndex
public final int audioTrackIndex
The index of the selected audio track
-
volume
public final float volume
The audio track volume
-
pauseOnHdmiDisconnected
public final boolean pauseOnHdmiDisconnected
Enable or disable automatic pausing on HDMI disconnected
-
videoTrackGroupIndex
public final int videoTrackGroupIndex
The index of the selected video track group
-
abrConfiguration
public final AbrConfiguration abrConfiguration
The initial video quality
-
bufferConfiguration
public final BufferConfiguration bufferConfiguration
The buffer configuration
-
liveConfiguration
@Nullable public final LiveConfiguration liveConfiguration
The Live configuration
-
networkConfiguration
@NonNull public final NetworkConfiguration networkConfiguration
The network configuration
-
trickplayConfiguration
@NonNull public final TrickplayConfiguration trickplayConfiguration
The Trickplay configuration
-
enableTrickplayMode
public final boolean enableTrickplayMode
Enable Trickplay mode at the start of the playback.- See Also:
trickplayConfiguration
-
enableDashEventCallback
public final boolean enableDashEventCallback
Enable internal handling of DASH event callbacks
-
mergeVideoTracks
public final boolean mergeVideoTracks
If True, the video tracks will be merged into a single video track
-
enableWorkaroundEveryVideoFrameIsSyncFrame
public final boolean enableWorkaroundEveryVideoFrameIsSyncFrame
If True, the workaround will be enabled to not treat the video frames as sync frames except the very first one. This flag may be needed to set up when the metadata of a video frame reports the video frame to be a sync frame (which is not in fact) but should not be treated as a sync frame by the decoder i.e. without the workaround the video artifacts appear upon every playback start and seek until the real key frame is rendered.
-
clipPeriods
public final boolean clipPeriods
If true then media periods will be clipped to their durations (currently is only applicable for DASH streams)
-
forceInStreamDrmInitData
public final boolean forceInStreamDrmInitData
If true then DRM init data from segments will be used instead of the one from manifest (currently is only applicable for DASH streams)
-
videoCodecFilter
public final int videoCodecFilter
The video codec filter
-
videoSizeFilter
public final Point videoSizeFilter
Deprecated.UseVideoFilterConfiguration.maxPixel
instead.The video size filter
-
preferredCodecInfos
@NonNull public final List<MediaCodecInfo> preferredCodecInfos
-
downloadFolder
@Nullable public final String downloadFolder
Download folder in case the content is played offline
-
enableTunneling
public final boolean enableTunneling
Enable tunneling support
-
enableTunnelingWithoutAudio
public final boolean enableTunnelingWithoutAudio
Force using of tunneling when audio track is disabled. To take effect theenableTunneling
should also be on.
-
analyticsSessionType
public final int analyticsSessionType
Analytics session type
-
userID
@Nullable public final String userID
User ID. Unique identifier for the current user.
-
adRequest
@Nullable public final AdRequest adRequest
The Ad request (if any)
-
enableAdSpeedUp
public final boolean enableAdSpeedUp
The flag to enable or disable automatic setting of a speed to 1x when playing ads.
-
restoreSpeed
public final boolean restoreSpeed
The flag to enable or disable automatic restoring of a speed after playing ads.
-
configurationUrl
@Nullable public final String configurationUrl
Optional configuration backend url
-
id
@NonNull public final String id
ID for this content
-
contentUrl
@NonNull public final String contentUrl
Playback url
-
contentType
public final int contentType
The content format
-
autoPlay
public final boolean autoPlay
Whether to autoplay or not
-
live
public final boolean live
Content live or VoD
-
threesixty
public final boolean threesixty
360 support
-
preferredTextLanguage
@Nullable public final String preferredTextLanguage
Preferred subtitles language
-
preferredAudioLanguage
@Nullable public final String preferredAudioLanguage
Preferred audio language
-
sideloadedTracks
@NonNull public final List<SideloadedTrack> sideloadedTracks
Array of side-loaded tracks, either subtitles or thumbnails
-
metaData
@Nullable public final Bundle metaData
Optional metadata
-
contentParameters
@Nullable public final Bundle contentParameters
Header params to add to content (manifest) requests
-
segmentParameters
@Nullable public final Bundle segmentParameters
Header params to add to segment requests
-
contentQueryParameters
public final Bundle contentQueryParameters
Query params to add to content (manifest) requests
-
segmentQueryParameters
@Nullable public final Bundle segmentQueryParameters
Query params to add to segment requests
-
drmConfiguration
@Nullable public final DrmConfiguration drmConfiguration
Drm configuration (if any)
-
casConfiguration
@Nullable public final CasConfiguration casConfiguration
Cas configuration (if any)
-
preservePlayerViewSurface
public final boolean preservePlayerViewSurface
If set to true and thePlayerView
is used, the playback surface be kept on screen and preserved when the player player is released. This allows to reuse (instead of re-create) the playback surface and can also be used to keep the last frame on screen even if the underlying player was already released.
-
pushBlackScreenOnDispose
public final boolean pushBlackScreenOnDispose
If true, indicates if the decoder should push a black screen to the surface when disposed. This is only relevant if you enabledpreservePlayerViewSurface
-
useStandaloneMediaClock
public boolean useStandaloneMediaClock
If set to true, will use Exoplayer'sStandaloneMediaClock
instead of the Renderer Clock.
-
enableLooping
public final boolean enableLooping
If set to true then the playback looping will be enabled and the player will automatically restart the playback after reaching end of content
-
analyticsMetaData
@Nullable public AnalyticsMetaData analyticsMetaData
The analytics meta-data
-
audioAttributes
@Nullable public AudioAttributes audioAttributes
The Audio Attributes. If set toSdkConsts.AUDIO_ATTRIBUTES_FOCUS_DISABLED
, the SDK won't request Audio Focus and play sound regardless of it. It is recommended to provide an instance ofAudioAttributes
, or at least use the default configuration.
-
adSchedule
@Nullable public AdSchedule adSchedule
Describes a custom ad schedule.
-
videoFilterConfiguration
@NonNull public final VideoFilterConfiguration videoFilterConfiguration
The video filter configuration
-
useEth0
@Nullable public final boolean useEth0
A boolean flag to indicate to use eth0 for multicast reception
-
videoDecoderFallback
public final boolean videoDecoderFallback
If true (default), allows the player to fallback to other decoders if it failed to initialize the primary decoder. This can for instance happen if the primary decoder is a hardware implementation and is already blocked by another playback session. In that case, secondary decoders, i.e. software implementations, will be used if possible.
-
audioDecoderFallback
public final boolean audioDecoderFallback
If true (default), allows the player to fallback to other decoders if it failed to initialize the primary decoder. This can for instance happen if the primary decoder is a hardware implementation and is already blocked by another playback session. In that case, secondary decoders, i.e. software implementations, will be used if possible.
-
unsecureDecoderFallback
public final boolean unsecureDecoderFallback
If true (default), allows the player to fallback to unsecure decoders if it failed to initialize the primary decoder. This requiresvideoDecoderFallback
to also be enabled.
-
allowHlsChunklessPreparation
public final boolean allowHlsChunklessPreparation
If set to true, chunk-less preparation of hls tracks are allowed
-
CREATOR
public static final Parcelable.Creator<PlayerConfig> CREATOR
-
-
Method Detail
-
guessFormat
public static int guessFormat(@NonNull String url)
Guess the format of the or returnSdkConsts.CONTENT_TYPE_UNKNOWN
.- Parameters:
url
- the url to the content- Returns:
- the format or
SdkConsts.CONTENT_TYPE_UNKNOWN
-
save
public void save(@NonNull Bundle bundle)
Saves the current configuration into aBundle
.- Parameters:
bundle
- the Bundle to which store thePlayerConfig
-
toBundle
public Bundle toBundle()
Obtain aBundle
filled with key-value pairs representing the current configuration. This Bundle can be used tostart playback
on aPlayerController
.- Returns:
- the Bundle
-
buildUpon
public PlayerConfig.Builder buildUpon()
Set theBuilder
values to the stored values in theBundle
.- Returns:
- the Builder
-
describeContents
public int describeContents()
- Specified by:
describeContents
in interfaceParcelable
-
writeToParcel
public void writeToParcel(Parcel dest, int flags)
- Specified by:
writeToParcel
in interfaceParcelable
-
-