VodPlayerFlutter class
- Mixed-in types
Constructors
Properties
-
currentResolution
→ Future<
TTVideoEngineResolutionType> -
Resolution === begin
When playing with a VideoID video source, the server will send down multiple playback addresses of different resolutions.
When the TTVideoEngine receives the fetchedVideoModel callback, you can call the supportedResolutionTypes method to obtain an array of all resolutions. You can use this array for displaying the resolution list and for the logic of selecting clarity.
Retrieve video clarity information, which should be obtained after onPrepared.
no setter
- didFinish ↔ void Function(TTError? error)?
-
play did finish
getter/setter pair
-
duration
→ Future<
Duration> -
no setter
- engineInstanceEventChannel ↔ EventChannel
-
latefinal
- engineInstanceMethodChannel ↔ MethodChannel
-
latefinaloverride-getter
- fetchedVideoModel ↔ void Function()?
-
The video has obtained a list of resolutions, which can be used for displaying the resolution list.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
-
isHardwareDecode
→ Future<
bool> -
Check if the current playback is hardware-accelerated, it should be called after onPrepared.
no setter
-
isSupportSuperResolution
→ Future<
bool> -
no setterinherited
-
isUseSuperResolutionPlayback
→ Future<
bool> -
no setterinherited
-
loadStateDidChanged
↔ void Function(TTVideoEngineLoadState loadState, Map<
Object?, Object?> ? extraInfo)? -
load State Change
getter/setter pair
-
looping
→ Future<
bool> -
no setter
- onClickPictureInPictureRestoreBtn ↔ VoidCallback?
-
getter/setter pairinherited
- onPrepared ↔ void Function()?
-
player prepared callback
getter/setter pair
- onStartPictureInPicture ↔ VoidCallback?
-
PiP lifecycle callbacks
getter/setter pairinherited
- onStopPictureInPicture ↔ VoidCallback?
-
getter/setter pairinherited
- onSubtitleFileLoadResult ↔ void Function(bool success)?
-
subtitle file load result callback
getter/setter pair
- onSubtitleSelected ↔ void Function(bool success, int subtitleId)?
-
subtitle selected callback
getter/setter pair
-
onSubtitlesFetched
↔ void Function(bool success, List<
TTSubtitle> ? subtitles, TTError? error)? -
vid source subtitle path info fetched callback
getter/setter pair
- onSubtitleShow ↔ void Function(String? content, int pts, int duration)?
-
subtitle frame update update callback
getter/setter pair
- onVideoEngineAutoSelectResolution ↔ void Function(TTVideoEngineResolutionType resolution)?
-
getter/setter pair
-
playableDuration
→ Future<
Duration> -
Buffered playback duration.
no setter
- playbackStateDidChanged ↔ void Function(TTVideoEnginePlaybackState playbackState)?
-
Playback State Change
getter/setter pair
-
position
→ Future<
Duration> -
no setter
- readyToDisplay ↔ void Function()?
-
video first frame rendered
getter/setter pair
- resolutionConfigCompletion ↔ void Function(bool success, TTVideoEngineResolutionType completeResolution)?
-
switch resolution finish
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- snapshotCompletion ↔ void Function(bool success, String filePath)?
-
snapshot finish
getter/setter pair
-
supportedResolutionTypes
→ Future<
List< TTVideoEngineResolutionType> > -
Retrieve the array of video resolutions.
no setter
-
videoHeight
→ Future<
int> -
no setter
-
videoWidth
→ Future<
int> -
Get the video width/height, it should be obtained after onPrepared.
no setter
Methods
-
closeAsync(
{bool closePictureInPicture = true}) → Future< void> -
Close the player asynchronously.
closePictureInPicturecontrols whether the associated PiP session should be terminated. Defaults to true to preserve existing behavior. -
configResolutionAfterStart(
{required TTVideoEngineResolutionType targetResolution, void completion(bool success, TTVideoEngineResolutionType completeResolution)?}) → Future< void> - Set the initial playback clarity: Preset the clarity information before playing. If there is no corresponding clarity level, it will automatically downgrade and traverse the list of supported clarity to find a suitable level.
-
configResolutionBeforeStart(
TTVideoEngineResolutionType resolution) → Future< void> - 设置起播的清晰度:在播放之前预设值清晰度信息,如果没有对应的清晰度档位,会自动降级遍历支持清晰度列表,查找合适的清晰度档位
-
createPlayer(
{String? vid, bool preCreated = false, bool useDrm = false}) → Future< String> - Create a Native player, it is recommended to call this first, immediately after the constructor.
-
enableAutoBackgroundPictureInPicture(
bool enable) → Future< void> -
background picture in picture auto
inherited
-
enablePlayCachedSource(
) → Future< void> - Enable Play downloaded videos By SDK
-
enableStartupAutoSelectBitrate(
bool enable) → Future< void> -
forceDraw(
) → Future< void> - Force refresh surface with last frame. Android only.
-
getCreatedPlayer(
{String? uuid}) → Future< int?> -
getDoubleOption(
int key) → Future< double?> -
getIntOption(
int key) → Future< int?> -
getLongOption(
int key) → Future< int?> -
getOption<
T> (int key) → Future< T?> -
getPlaybackState(
) → Future< TTVideoEnginePlaybackState> -
getStringOption(
int key) → Future< String?> -
getVolume(
) → Future< TTVolume?> - get volume
-
isPictureInPictureStarted(
) → Future< bool> -
isPictureInPictureStarted
inherited
-
isPictureInPictureSupported(
) → Future< bool> -
isPictureInPictureSupported
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
openTextureRender(
bool open) → Future< void> - enable TextureRender
-
pause(
) → Future< void> -
play(
) → Future< void> -
seekToTimeMs(
{required double time, void seekCompleted(bool)?, void seekRenderCompleted()?}) → Future< void> - seek to time.
-
setClipToBounds(
bool clip) → Future< void> - mute default is NO , only for iOS
-
setCustomHeader(
String key, String value) → Future< void> - Set custom HTTP Header in the playback request.
-
setHardwareDecode(
bool isHardwareDecode) → Future< void> - Set hardware decoding, the default value is true, it needs to be set before calling play().
-
setHLSMultiBitrateConfig(
{void getHlsStreamInfos(TTMasterPlaylist playlist)?, int? selectHlsVideoStream()?, int? selectHlsRendition(int variantIndex)?, void switchHlsVideoBitrate(int bitrate)?}) → Future< void> - resolution === end master-m3u8 === begin
-
setLooping(
bool looping) → Future< void> - set loop play
-
setMediaSource(
TTVideoEngineMediaSource source) → Future< void> - set play source
-
setMirrorHorizontal(
bool mirror) → Future< void> - Set horizontal mirroring.
-
setMirrorVertical(
bool mirror) → Future< void> - Set vertical mirroring.
-
setMuted(
bool muted) → Future< void> - mute
-
setOption<
T> (int key, T value) → Future< void> - Call after createPlayer(). T valid types: bool, int, string, double
-
setPlaybackSpeed(
double speed) → Future< void> - Set the playback speed, with a value range of 0.1 to 3.0.
-
setPlayerContainerView(
int viewId) → Future< void> - Set the player's ContainerView, pass in TTVideoPlayerView.viewId. @see class TTVideoPlayerView
-
setRadioMode(
bool radioMode) → Future< void> - only audio playback.
-
setRotation(
int angle) → Future< void> - rotate
-
setScalingMode(
TTVideoEngineScalingMode mode) → Future< void> - set video scale mode
-
setSelectedSubtitle(
int subtitleId) → Future< void> -
setSimulatorEnable(
bool simulatorEnable) → Future< void> - support arm64 iOS simulator, the default value is false, it needs to be set before calling play().
-
setSmoothSwitchEnable(
bool smoothSwitchEnable) → Future< void> - Set smooth switch enable when config resolution, the default value is false, it needs to be set before calling play().
-
setStartTimeMs(
double startTime) → Future< void> - Set the starting playback position, unit: milliseconds.
-
setSubTag(
String subTag) → Future< void> - Custom tag "subtag" is used to differentiate between different subdivisions within the same business type, such as encrypted videos, non-encrypted videos, audios, etc.
-
setSubtitleAuthToken(
String subtitleAuthToken) → Future< void> -
setSubtitleEnabled(
bool enabled) → Future< void> -
setSubtitles(
List< TTSubtitle> subtitles) → Future<void> -
setSubtitleShow(
bool show) → Future< void> -
setSuperReoslutionEnabled(
bool enabled) → Future< void> -
inherited
-
setSuperResolutionInitConfig(
TTVideoEngineSRConfig srConfig) → Future< void> -
inherited
-
setTag(
String tag) → Future< void> - Business type (tag) is used to distinguish different types of audio and video within the same application (appid). It can be divided according to business needs based on video scenarios, video duration, etc.: such as immersive feed streams, short videos, long videos, etc.
-
setTrackVolumeEnabled(
bool isEnabled) → Future< void> -
setUrlSource(
TTVideoEngineUrlSource source) → Future< void> -
setVideoModelSource(
TTVideoEngineVideoModelSource source) → Future< void> -
setVidSource(
TTVideoEngineVidSource source) → Future< void> -
setVolume(
{required TTVolume volume}) → Future< void> - set volume @Note: In iOS, the volume of the left and right audio channels is consistent; when there is a discrepancy, iOS takes the value of the left channel.
-
snapshot(
{required String path, void completion(bool success, String filePath)?}) → Future< void> - master-m3u8 === end snapshot
-
startPictureInPicture(
) → Future< bool> -
Start picture in picture
inherited
-
stop(
) → Future< void> -
stopPictureInPicture(
) → Future< void> -
Stop picture in picture
inherited
-
switchHlsAudioRendition(
{required dynamic audioInfoId}) → Future< void> - Switching audio tracks during HLS playback, if the passed audioInfoId does not exist, do not switch.
-
switchHlsVideoBitrate(
{required int bitrate}) → Future< void> - Switching HLS video quality during playback, if the passed bitrate level does not exist, select the closest available quality level.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
closePictureInPictureWindow(
) → Future< void> - Close the global PiP window on the platform side if it is active.
-
preRenderFirstFrame(
{String vid = '', int viewId = 0, dynamic displayMode = TTVideoEngineScalingMode.TTVideoEngineScalingModeAspectFill}) → Future< String?> -
requestOverlayPermission(
) → Future< void> - Request overlay permission for floating window (Android only) This will open the system settings page for overlay permission
Constants
- engineStaticMethodChannel → const MethodChannel
- Channel for TTVideoEngine Meta Class