Package com.castlabs.android.player
Class PlayerConfig
java.lang.Object
com.castlabs.android.player.PlayerConfig
- All Implemented Interfaces:
Parcelable
Object which represents a specific Player configuration.
You can use a PlayerConfig
object to start playback on a PlayerController
calling
its PlayerController.open(PlayerConfig)
method.
An instance can be built with the PlayerConfig.Builder
. The Builder
can be populated with
an already existing PlayerConfig
or with a Bundle
.
It is possible to convert an instance of PlayerConfig
toBundle()
. This
Bundle
can also be used to PlayerController.open(Bundle)
the
PlayerController
.
This class is Parcelable
.
- Since:
- 4.2.1
-
Nested Class Summary
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
-
Field Summary
Modifier and TypeFieldDescriptionfinal AbrConfiguration
The initial video qualityfinal AdRequest
The Ad request (if any)Describes a custom ad schedule.final boolean
If set to true, chunk-less preparation of hls tracks are allowedThe analytics meta-datafinal int
Analytics session typeThe Audio Attributes.final boolean
If true (default), allows the player to fallback to other decoders if it failed to initialize the primary decoder.final int
The index of the selected audio track groupfinal int
The index of the selected audio trackfinal boolean
Whether to autoplay or notfinal BufferConfiguration
The buffer configurationfinal CasConfiguration
Cas configuration (if any)final boolean
If true then media periods will be clipped to their durations (currently is only applicable for DASH streams)final long
The clipping end position in microsecondsfinal long
The clipping start position in microsecondsfinal String
Optional configuration backend urlfinal Bundle
Header params to add to content (manifest) requestsfinal Bundle
Query params to add to content (manifest) requestsfinal int
The content formatfinal String
Playback urlstatic final Parcelable.Creator
<PlayerConfig> final String
Download folder in case the content is played offlinefinal DrmConfiguration
Drm configuration (if any)final boolean
The flag to enable or disable automatic setting of a speed to 1x when playing ads.final boolean
Enable internal handling of DASH event callbacksfinal boolean
If set to true then the playback looping will be enabled and the player will automatically restart the playback after reaching end of contentfinal boolean
Enable Trickplay mode at the start of the playback.final boolean
Enable tunneling supportfinal boolean
Force using of tunneling when audio track is disabled.final boolean
If True, the workaround will be enabled to not treat the video frames as sync frames except the very first one.final boolean
If true then DRM init data from segments will be used instead of the one from manifest (currently is only applicable for DASH streams)final String
ID for this contentstatic final String
A unique ID for the configurationstatic final String
Intent key to specify an optional URL to an API endpoint that can be used to refresh the configuration.static final String
Indicates live contentstatic final String
Additional Bundle-formatted meta-data such as poster images, titles, byline and any custom meta-datastatic final String
Preferred media codec infosstatic final String
Indicates 360 degree contentfinal boolean
Content live or VoDfinal LiveConfiguration
The Live configurationfinal boolean
If True, the video tracks will be merged into a single video trackfinal Bundle
Optional metadatafinal NetworkConfiguration
The network configurationfinal boolean
Enable or disable automatic pausing on HDMI disconnectedfinal long
The position in microseconds.final String
Preferred audio languagefinal List
<MediaCodecInfo> final String
Preferred subtitles languagefinal boolean
If set to true and thePlayerView
is used, the playback surface be kept on screen and preserved when the player player is released.final boolean
If true, indicates if the decoder should push a black screen to the surface when disposed.final boolean
The flag to enable or disable automatic restoring of a speed after playing ads.final Bundle
Header params to add to segment requestsfinal Bundle
Query params to add to segment requestsfinal List
<SideloadedTrack> Array of side-loaded tracks, either subtitles or thumbnailsfinal int
The index of the selected subtitle track group or -1 for if subtitles are disabledfinal int
The index of the selected subtitle track or -1 for if subtitles are disabledfinal int
Defines whether the subtitle times are absolute or relative.final boolean
360 supportfinal TrickplayConfiguration
The Trickplay configurationfinal boolean
If true (default), allows the player to fallback to unsecure decoders if it failed to initialize the primary decoder.final boolean
A boolean flag to indicate to use eth0 for multicast receptionfinal String
User ID.boolean
If set to true, will use Exoplayer'sStandaloneMediaClock
instead of the Renderer Clock.final int
The video codec filterfinal boolean
If true (default), allows the player to fallback to other decoders if it failed to initialize the primary decoder.final VideoFilterConfiguration
The video filter configurationfinal Point
Deprecated.final int
The index of the selected video track groupfinal float
The audio track volumeFields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
Method Summary
Modifier and TypeMethodDescriptionSet theBuilder
values to the stored values in theBundle
.int
boolean
static int
guessFormat
(String url) Guess the format of the or returnSdkConsts.CONTENT_TYPE_UNKNOWN
.int
hashCode()
void
Saves the current configuration into aBundle
.toBundle()
Obtain aBundle
filled with key-value pairs representing the current configuration.void
writeToParcel
(Parcel dest, int flags)
-
Field Details
-
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:
-
INTENT_CONFIGURATION_ID
A unique ID for the configuration- See Also:
-
INTENT_LIVE
Indicates live content- See Also:
-
INTENT_THREESIXTY
Indicates 360 degree content- See Also:
-
INTENT_METADATA
Additional Bundle-formatted meta-data such as poster images, titles, byline and any custom meta-data- See Also:
-
INTENT_PREFERRED_CODEC_INFOS
Preferred media codec infos- See Also:
-
positionUs
public final long positionUsThe 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 clippingStartUsThe clipping start position in microseconds -
clippingEndUs
public final long clippingEndUsThe clipping end position in microseconds -
subtitlesTrackGroupIndex
public final int subtitlesTrackGroupIndexThe index of the selected subtitle track group or -1 for if subtitles are disabled -
subtitlesTrackIndex
public final int subtitlesTrackIndexThe index of the selected subtitle track or -1 for if subtitles are disabled -
audioTrackGroupIndex
public final int audioTrackGroupIndexThe index of the selected audio track group -
audioTrackIndex
public final int audioTrackIndexThe index of the selected audio track -
volume
public final float volumeThe audio track volume -
pauseOnHdmiDisconnected
public final boolean pauseOnHdmiDisconnectedEnable or disable automatic pausing on HDMI disconnected -
videoTrackGroupIndex
public final int videoTrackGroupIndexThe index of the selected video track group -
abrConfiguration
The initial video quality -
bufferConfiguration
The buffer configuration -
liveConfiguration
The Live configuration -
networkConfiguration
The network configuration -
trickplayConfiguration
The Trickplay configuration -
enableTrickplayMode
public final boolean enableTrickplayModeEnable Trickplay mode at the start of the playback.- See Also:
-
enableDashEventCallback
public final boolean enableDashEventCallbackEnable internal handling of DASH event callbacks -
mergeVideoTracks
public final boolean mergeVideoTracksIf True, the video tracks will be merged into a single video track -
enableWorkaroundEveryVideoFrameIsSyncFrame
public final boolean enableWorkaroundEveryVideoFrameIsSyncFrameIf 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 clipPeriodsIf true then media periods will be clipped to their durations (currently is only applicable for DASH streams) -
forceInStreamDrmInitData
public final boolean forceInStreamDrmInitDataIf 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 videoCodecFilterThe video codec filter -
videoSizeFilter
Deprecated.UseVideoFilterConfiguration.maxPixel
instead.The video size filter -
preferredCodecInfos
-
downloadFolder
Download folder in case the content is played offline -
enableTunneling
public final boolean enableTunnelingEnable tunneling support -
enableTunnelingWithoutAudio
public final boolean enableTunnelingWithoutAudioForce using of tunneling when audio track is disabled. To take effect theenableTunneling
should also be on. -
analyticsSessionType
public final int analyticsSessionTypeAnalytics session type -
userID
User ID. Unique identifier for the current user. -
adRequest
The Ad request (if any) -
enableAdSpeedUp
public final boolean enableAdSpeedUpThe flag to enable or disable automatic setting of a speed to 1x when playing ads. -
restoreSpeed
public final boolean restoreSpeedThe flag to enable or disable automatic restoring of a speed after playing ads. -
configurationUrl
Optional configuration backend url -
id
ID for this content -
contentUrl
Playback url -
contentType
public final int contentTypeThe content format -
autoPlay
public final boolean autoPlayWhether to autoplay or not -
live
public final boolean liveContent live or VoD -
threesixty
public final boolean threesixty360 support -
preferredTextLanguage
Preferred subtitles language -
preferredAudioLanguage
Preferred audio language -
sideloadedTracks
Array of side-loaded tracks, either subtitles or thumbnails -
metaData
Optional metadata -
contentParameters
Header params to add to content (manifest) requests -
segmentParameters
Header params to add to segment requests -
contentQueryParameters
Query params to add to content (manifest) requests -
segmentQueryParameters
Query params to add to segment requests -
drmConfiguration
Drm configuration (if any) -
casConfiguration
Cas configuration (if any) -
preservePlayerViewSurface
public final boolean preservePlayerViewSurfaceIf 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 pushBlackScreenOnDisposeIf 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 useStandaloneMediaClockIf set to true, will use Exoplayer'sStandaloneMediaClock
instead of the Renderer Clock. -
enableLooping
public final boolean enableLoopingIf set to true then the playback looping will be enabled and the player will automatically restart the playback after reaching end of content -
analyticsMetaData
The analytics meta-data -
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
Describes a custom ad schedule. -
videoFilterConfiguration
The video filter configuration -
useEth0
@Nullable public final boolean useEth0A boolean flag to indicate to use eth0 for multicast reception -
videoDecoderFallback
public final boolean videoDecoderFallbackIf 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 audioDecoderFallbackIf 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 unsecureDecoderFallbackIf 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 allowHlsChunklessPreparationIf set to true, chunk-less preparation of hls tracks are allowed -
subtitleSubSampleType
public final int subtitleSubSampleTypeDefines whether the subtitle times are absolute or relative. Could be one ofSdkConsts.SUBTITLE_SUB_SAMPLE_TYPE_ABSOLUTE
orSdkConsts.SUBTITLE_SUB_SAMPLE_TYPE_RELATIVE
-
CREATOR
-
-
Method Details
-
guessFormat
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
Saves the current configuration into aBundle
.- Parameters:
bundle
- the Bundle to which store thePlayerConfig
-
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
Set theBuilder
values to the stored values in theBundle
.- Returns:
- the Builder
-
describeContents
public int describeContents()- Specified by:
describeContents
in interfaceParcelable
-
writeToParcel
- Specified by:
writeToParcel
in interfaceParcelable
-
hashCode
public int hashCode() -
equals
-
VideoFilterConfiguration.maxPixel
instead.