TXVodPlayerController class
- Inheritance
-
- Implemented types
-
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 track
@param trackIndex track index, obtained through trackIndex of TXTrackInfo
-
dispose()
→ Future<void>
-
release controller
override
-
enableHardwareDecode(bool enable)
→ Future<bool>
-
Enable/Disable hardware encoding.
override
-
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 video player is in picture-in-picture mode.
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 current amount of video that has been buffered.
-
getCurrentPlaybackTime()
→ Future<double>
-
Get the current playback time, in seconds.
-
getDuration()
→ Future<double>
-
To 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 current playable duration of the 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 playing a video
Bitrate:index:bitrate index,
width:the video with of this bitrate,
height:the video height of this bitrate,
bitrate:bitrate value
-
getWidth()
→ Future<int>
-
Get the width of the currently playing video.
-
initialize({bool? onlyAudio})
→ Future<void>
-
To initialize the player, you would need to create a shared texture and initialize the player.
@param onlyAudio 是否是纯音频模式 if pure audio mode
override
-
initImageSprite(String? vvtUrl, List<String>? imageUrls)
→ Future<void>
-
-
isLoop()
→ Future<bool>
-
Is the currently playing video set to loop
-
isPlaying()
→ Future<bool>
-
Is the video 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
-
override
-
onPlayerEvent(Map event)
→ void
-
event type:
override
-
pause()
→ Future<void>
-
pause video, it must be called when the player starts playing
override
-
playerValue()
→ TXPlayerValue?
-
override
-
printVersionInfo()
→ 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, it should be called when the video is paused
override
-
seek(double progress)
→ Future<void>
-
Set the video playback progress to a specific time and start playing.
-
seekToPdtTime(int pdtTimeMs)
→ Future<void>
-
此接口仅播放器高级版本(Player_Premium)支持,需要购买播放器移动端高级版 License
跳转到视频流指定PDT时间点, 可实现视频快进,快退,进度条跳转等功能
播放器高级版 11.6 版本开始支持
@param pdtTimeMs 视频流PDT时间点,单位毫秒(ms)
-
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 track
@param trackIndex track index, obtained through trackIndex of TXTrackInfo
-
setAudioPlayoutVolume(int volume)
→ Future<void>
-
Set the volume of the video, ranging from 0 to 100.
-
setAutoPlay({bool? isAutoPlay})
→ Future<void>
-
set autoplay
-
setBitrateIndex(int index)
→ Future<void>
-
Set the index of the bitrate setting.
-
setConfig(FTXVodPlayConfig config)
→ Future<void>
-
Set player configuration
-
setLoop(bool loop)
→ Future<void>
-
Set whether to loop playback or not
-
setMute(bool mute)
→ Future<void>
-
Set whether to mute or not
override
-
setPlayerView(int renderViewId)
→ Future<void>
-
override
-
setRate(double rate)
→ Future<void>
-
Set the playback speed, with a default speed of 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 video playback, in seconds.
-
setStringOption(String key, Object value)
→ Future<void>
-
-
setToken(String? token)
→ Future<void>
-
Set the token 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#.E8.B4.AD.E4.B9.B0.E5.B9.B6.E6.96.B0.E5.BB.BA.E6.AD.A3.E5.BC.8F.E7.89.88-license).
-
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#.E8.B4.AD.E4.B9.B0.E5.B9.B6.E6.96.B0.E5.BB.BA.E6.AD.A3.E5.BC.8F.E7.89.88-license).
-
stop({bool isNeedClear = false})
→ Future<bool>
-
Stop playback
override
-
toString()
→ String
-
A string representation of this object.
inherited
Static Properties
-
kTag
↔ String
-
getter/setter pair