TXVodPlayerController class

Inheritance
Implemented types

Constructors

TXVodPlayerController({bool? onlyAudio})

Properties

hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
onPlayerEventBroadcast Stream<Map>
Playback event listener. @see https://cloud.tencent.com/document/product/454/7886
no setter
onPlayerNetStatusBroadcast Stream<Map>
VOD player network status callback. @see https://cloud.tencent.com/document/product/454/7886
no setter
onPlayerState Stream<TXPlayerState?>
Playback state listener. @see TXPlayerState
no setter
playState TXPlayerState?
no setter
resizeVideoHeight double?
getter/setter pairoverride-getter
resizeVideoWidth double?
getter/setter pairoverride-getter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value TXPlayerValue?
The current value of the object.
getter/setter pairoverride-getter
videoBottom double?
getter/setter pairoverride-getter
videoLeft double?
getter/setter pairoverride-getter
videoRight double?
getter/setter pairoverride-getter
videoTop double?
getter/setter pairoverride-getter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
addSubtitleSource(String url, String name, {String? mimeType}) Future<void>
This interface is only supported by the premium version of the player (Player_Premium), and you need to purchase the premium version of the player mobile license. Add external subtitles @param url subtitle address @param name The name of the subtitle. If you add multiple subtitles, please set the subtitle name to a different name to distinguish it from other added subtitles, otherwise it may lead to incorrect subtitle selection. @param mimeType subtitle type, only supports VVT and SRT formats VOD_PLAY_MIMETYPE_TEXT_SRT VOD_PLAY_MIMETYPE_TEXT_VTT Later, you can get the corresponding name through the name in the result returned by getSubtitleTrackInfo.
deselectTrack(int trackIndex) Future<void>
This interface is only supported by the premium version of the player (Player_Premium), and you need to purchase the premium version of the player mobile license. Deselect a track. @param trackIndex track index, obtained from trackIndex of TXTrackInfo
dispose() Future<void>
Release the controller.
override
enableHardwareDecode(bool enable) Future<bool>
Enable or disable hardware decoding.
override
enableTRTC(bool isEnable) Future<void>
enterPictureInPictureMode({String? backIconForAndroid, String? playIconForAndroid, String? pauseIconForAndroid, String? forwardIconForAndroid}) Future<int>
To enter Picture-in-Picture mode, you need to adapt the interface for Picture-in-Picture mode. On Android, this feature is only supported on devices running Android 7.0 or higher.
override
exitPictureInPictureMode() Future<void>
Exit picture-in-picture mode if the player is currently in it.
override
getAudioTrackInfo() Future<List<TXTrackInfo>>
This interface is only supported by the premium version of the player (Player_Premium), and you need to purchase the premium version of the player mobile license. Returns the audio track information list.
getBitrateIndex() Future<int>
Get the index of the current bitrate setting.
getBufferDuration() Future<double>
Get the buffered duration of the current video.
getCurrentPlaybackTime() Future<double>
Get the current playback time, in seconds.
getDuration() Future<double>
Get the total duration.
getHeight() Future<int>
Get the height of the currently playing video.
getImageSprite(double time) Future<Uint8List?>
getPlayableDuration() Future<double>
Get the playable duration of the current video.
getSubtitleTrackInfo() Future<List<TXTrackInfo>>
This interface is only supported by the premium version of the player (Player_Premium), and you need to purchase the premium version of the player mobile license. Returns the subtitle track information list.
getSupportedBitrates() Future<List?>
Get the bitrate information extracted from the playing video. Each bitrate item contains: index: bitrate index width: video width of this bitrate height: video height of this bitrate bitrate: bitrate value
getWidth() Future<int>
Get the width of the currently playing video.
initialize({bool? onlyAudio}) Future<void>
Initialize the player, which creates a shared texture and initializes the player. @param onlyAudio whether to use pure audio mode
override
initImageSprite(String? vvtUrl, List<String>? imageUrls) Future<void>
isLoop() Future<bool>
Whether loop playback is enabled.
isPlaying() Future<bool>
Whether the video is currently playing.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
onNetEvent(Map event) → void
Network status event (dispatched by VodEventDispatcher).
onPlayerEvent(Map event) → void
Event type. @see https://cloud.tencent.com/document/product/454/7886
pause() Future<void>
Pause playback. Must be called after the player has started playing.
override
playerValue() TXPlayerValue?
override
printVersionInfo() → void
publishAudio() Future<void>
publishVideo() Future<void>
reDraw() Future<void>
only valid on Android
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
resume() Future<void>
Resume playback. Should be called when the player is paused.
override
seek(double progress) Future<void>
Seek to the specified playback position and start playing. @param progress target playback time in seconds
seekToPdtTime(int pdtTimeMs) Future<void>
Only supported by Player_Premium (requires the mobile premium license). Jump to the specified PDT time point of the video stream, enabling fast forward, fast rewind, and progress bar seeking. Supported since Player Premium 11.6. @param pdtTimeMs video stream PDT time point, in milliseconds
selectTrack(int trackIndex) Future<void>
This interface is only supported by the premium version of the player (Player_Premium), and you need to purchase the premium version of the player mobile license. Select a track. @param trackIndex track index, obtained from trackIndex of TXTrackInfo
setAudioPlayoutVolume(int volume) Future<void>
Set the playback volume. Range: 0-100.
setAutoPlay({bool? isAutoPlay}) Future<void>
Set autoplay.
setBitrateIndex(int index) Future<void>
Set the bitrate index.
setConfig(FTXVodPlayConfig config) Future<void>
Set player configuration. @see FTXVodPlayConfig
setLoop(bool loop) Future<void>
Set loop playback.
setMute(bool mute) Future<void>
Set mute.
override
setPlayerView(int renderViewId) Future<void>
override
setRate(double rate) Future<void>
Set the playback speed. Default is 1.
setRenderMode(FTXPlayerRenderMode renderMode) Future<void>
override
setRequestAudioFocus(bool focus) Future<bool>
Request audio focus.
setStartTime(double startTime) Future<void>
Set the start time of the playback, in seconds.
setStringOption(String key, Object value) Future<void>
setSubtitleStyle(TXSubtitleRenderModel model) Future<void>
Set the subtitle render style. @param model subtitle render parameters, see TXSubtitleRenderModel
setToken(String? token) Future<void>
Set the token used for playing the video.
startPlayDrm(TXPlayerDrmBuilder drmBuilder) Future<void>
startVodPlay(String url) Future<bool>
Starting from version 10.7, the method startPlay has been changed to startVodPlay for playing videos via a URL. To play videos successfully, it is necessary to set the license by using the method SuperPlayerPlugin#setGlobalLicense. Failure to set the license will result in video playback failure (a black screen). Live streaming, short video, and video playback licenses can all be used. If you do not have any of the above licenses, you can apply for a free trial license to play videos normallyQuickly apply for a free trial version Licence (https://cloud.tencent.com/act/event/License).Official licenses can be purchased (https://cloud.tencent.com/document/product/881/74588).
startVodPlayWithParams(TXPlayInfoParams params) Future<void>
Starting from version 10.7, the method "startPlayWithParams" has been changed to "startVodPlayWithParams" for playing videos using fileId. To play the video successfully, you need to set the Licence using "SuperPlayerPlugin#setGlobalLicense" method before playing the video. If you do not set the Licence, the video will not play (black screen). The Licence for live streaming, short video, and video playback can all be used. If you have not obtained the Licence, you can apply for a free trial version here (https://cloud.tencent.com/act/event/License) for normal playback. To use the official version, you need to purchase (https://cloud.tencent.com/document/product/881/74588).
stop({bool isNeedClear = false}) Future<bool>
Stop playback. @return whether the stop succeeded
override
toString() String
A string representation of this object.
inherited
unpublishAudio() Future<void>
unpublishVideo() Future<void>

Operators

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

Static Properties

kTag String
getter/setter pair