SuperPlayerPlugin class

SuperPlayer global capability wrapper (corresponds to the native TencentVodPlugin MethodChannel).

Migration notes:

  • Previously implemented via Pigeon-generated bindings. Now unified to VodGlobalChannel.plugin using MethodChannel, aligned with the v3 plugin.
  • Event callbacks (SDK Listener / native events / PiP events) are routed through VodEventDispatcher, dispatched by the native side via onSDKListener / onNativeEvent / onPipEvent MethodCalls.
  • Public API signatures and semantics remain 100% compatible with the original SuperPlayer version; business callers require no changes.

Properties

hashCode int
The hash code for this object.
no setterinherited
onEventBroadcast Stream<Map>
Native interaction, common event listener, events from the plugin, such as sound change events.
no setter
onExtraEventBroadcast Stream<Map>
Native interaction, common event listener, events from the native container, such as PIP events, activity/controller lifecycle changes.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setSDKListener({FTXLicenceLoadedListener? licenceLoadedListener}) → void
Set up SDK listeners, currently there is a license loading listener, and other types of listeners will be gradually opened in the future.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

instance SuperPlayerPlugin
no setter
platformVersion Future<String?>
no setter

Static Methods

createVodPlayer({bool? onlyAudio}) Future<int?>
Creating a VOD player
getLiteAVSDKVersion() Future<String?>
Getting the version of LiteAVSDK that depends on the native side
isDeviceSupportPip() Future<int?>
Whether the current device supports picture-in-picture mode. @return TXVodPlayEvent 0 Picture-in-picture mode can be enabled. -101 The Android version is too low. -102 Picture-in-picture permission is disabled or the device does not support picture-in-picture mode. -103 The current interface has been destroyed.
releasePlayer(int? playerId) Future<void>
Releasing player resources
setConsoleEnabled(bool enabled) Future<void>
Turning on/off log output
setDrmProvisionEnv(TXDrmProvisionEnv env) Future<void>
Set the DRM certificate provider environment. See TXDrmProvisionEnv.
setGlobalCacheFolderCustomPath({String? androidAbsolutePath, String? iOSAbsolutePath}) Future<bool?>
Set the absolute path of the player resource cache directory. This method will override each other with setGlobalCacheFolderPath(String postfixPath), and you only need to call one of them.
setGlobalCacheFolderPath(String postfixPath) Future<bool?>
Local caching of video files is a highly demanded feature in short video playback scenarios. For ordinary users, when watching a video that has already been viewed, it should not consume data traffic again. @Format support: The SDK supports caching for two common VOD formats: HLS(m3u8) and MP4. @Timing of enabling: The SDK does not enable caching by default, and it is not recommended to enable this feature for scenarios with low user review rates. @Method of enabling: Global effect, enabled with the player. To enable this feature, two parameters need to be configured: the local cache directory and the cache size.
setGlobalEnv(String envConfig) Future<int?>
Setting the environment for accessing the LiteAV SDK. Tencent Cloud has deployed environments in various regions around the world, and different access points need to be accessed according to local policies and regulations.
setGlobalLicense(String licenceUrl, String licenceKey) Future<void>
Setting the global license
setGlobalMaxCacheSize(int size) Future<void>
Setting the maximum cache size for the playback engine. After setting, files in the Cache directory will be automatically cleaned up based on the set value. @param size Maximum cache size (unit: MB).
setLicenseFlexibleValid(bool enabled) Future<void>
Enable flexible verification of player License; once enabled, the verification will pass by default for the first two times after the player is launched for the first time.
setLogLevel(int logLevel) Future<void>
Setting the log output level TXLogLevel
setUserId(String userId) Future<void>
Set the userId to facilitate problem localization.
startVideoOrientationService() Future<bool?>
Starts listening for device rotation direction. After it is turned on, if the device's auto-rotation is turned on, the player will automatically rotate the video direction based on the current device orientation.

Constants

TAG → const String