ElementsPlayerController class

Constructors

ElementsPlayerController.new({required int viewId})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
viewId int
The view identifier associated with this ElementsPlayerController instance
final

Methods

disableAdvertising() Future<void>
Pauses player advertising, note that a running ad will finish if this method is called
enableAdvertising() Future<void>
If advertising was previously disabled by the disableAdvertising call, it will enable it back
getAvailableQualities() Future<List?>
Returns a List with the available resolutions of the currently playing video
getQuality() Future<int?>
Returns the current resolution of the video
getSubtitles() Future<List?>
Returns the list of available subtitles for the current media
getVideoCurrentPosition() Future<double?>
Returns the timestamp of the currently playing video in seconds
getVideoDetails() Future<Map?>
Returns the details of the currently playing video
getVideoDuration() Future<double?>
Returns the duration of the currently playing video in seconds
getVideoIndex() Future<int?>
Returns the index of the video currently playing from the current playlist. If the playlist only has 1 video, the method returns the numeric value 0
listenFor(String event, bool once) Future<void>
Listens to a single player event. Can be done once or as long as the player is alive
listenForAllEvents() → void
Listens to all available player events. Please check the documentation for all the possible event types
listenForMore(List<String> events) Future<void>
Listens to a String array of player event
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause() Future<void>
Sets the player state to "pause"
play() Future<void>
Sets the player state to "play"
registerListener(ElementsPlayerControllerDelegate? delegate) → dynamic
Registers the delegate as the listener for player events
remove(String event) Future<void>
Removes the listener for the specified player String event type
removeAllEvents() → void
Removes the listeners for all player events
removeListener() → dynamic
Removes the listener for player events
setAutoQuality() Future<void>
Sets the video quality to Auto. Auto quality will be determined by the height of the video element
setElementsConfig(String config) Future<void>
Sets the configuration for the Elements player
setMacros(String macrosJsonString) Future<void>
Sets custom macros. The method uses key value pairs of macros { key: value }. Please note that Connatix Macros will NOT we overridden
setPostRollBreak(int seconds) Future<void>
Dynamically set the post-roll break duration. This method needs to be called with the duration in seconds. To disable the break call this with 0 value
setPreRollBreak(int seconds) Future<void>
Dynamically set the pre-roll break duration. This method needs to be called with the duration in seconds. To disable the break call this with 0 value
setQuality(int videoQuality) Future<void>
Sets the resolution of the video to the specified videoQuality
setSubtitle(String trackJsonString) Future<void>
Sets a subtitle from the list obtained from getSubtitles. If no value is given or the subtitle is invalid (not found in the list), subtitles will be turned off
setVideoIndex(int index) Future<void>
Sets the playing video with the one found in the playlist at the index provided. The index provided should be a numeric value between 0 and the total number of videos in the current playlist - 1. If the index provided is less than 0 or greater or equal with the total number of videos, the method shows an error message and returns
setVolume(double volume) Future<void>
Sets the player volume to the specified value
stopPlayer() → void
Stops every function of the player, including the ad session. The player will need to be restarted after this
toggleFullscreen() Future<void>
Toggles the player full screen state. Only use this method on user interaction
toggleSubtitles(bool shouldShow) Future<void>
Shows or hides the video subtitles based on the given boolean. Value is necessary
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited