ByteRTCKTVPlayer class

Inheritance
  • Object
  • NativeClass
  • ByteRTCKTVPlayer

Constructors

ByteRTCKTVPlayer([NativeClassOptions? options])

Properties

$resource → NativeResource
no setterinherited
delegate FutureOr<ByteRTCKTVPlayerDelegate?>
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
ready Future<void>
Whether the instance is initialized
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

destroy() → void
inherited
nativeCall<T>(String method, [List? args, NativeMethodMeta? meta]) Future<T>
Call instance method
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pauseMusic(NSString musicId) FutureOr<void>
@detail api @author lihuan.wuti2ha @brief Pauses the music. @param musicId Music ID. @note - After calling this API, you will receive the music play state through ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback. - If the music ID is invalid, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3023 and a playState of 4. - If you didn't join the room, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3022 and a playState of 4.
playMusic(NSString musicId, ByteRTCAudioTrackType trackType, ByteRTCAudioPlayType playType) FutureOr<void>
@detail api @author lihuan.wuti2ha @brief Plays the music. @param musicId Music ID.
If the song with the same musicId is playing when you call this API, the music will restart from the starting position. An error will be triggered if the audio file corresponding to musicId does not exist. @param trackType Audio track type of the KTV player. See ByteRTCAudioTrackType{@link #ByteRTCAudioTrackType}. @param playType Audio play type. See ByteRTCAudioPlayType{@link #ByteRTCAudioPlayType}. @note - After calling this API, you will receive the music play state through ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback. - If the music ID is invalid, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3023 and a playState of 4. - If you didn't join the room, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3022 and a playState of 4. - If the music file does not exist, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3020 and a playState of 4.
resumeMusic(NSString musicId) FutureOr<void>
@detail api @author lihuan.wuti2ha @brief Resumes playing the music. @param musicId Music ID. @note - After calling this API, you will receive the music play state through ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback. - If the music ID is invalid, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3023 and a playState of 4. - If you didn't join the room, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3022 and a playState of 4.
seekMusic(NSString musicId, int position) FutureOr<void>
@detail api @author lihuan.wuti2ha @brief Sets the starting position of the music file. @param musicId Music ID. @param position The starting position of the music file in milliseconds. The value must be less than the total length of the music. @note - The music must be playing when you call this API. - After calling this API, you will receive the music play state through ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback. - If the music ID is invalid, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3023 and a playState of 4. - If you didn't join the room, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3022 and a playState of 4.
sendInstanceGet<T>(String property) Future<T>
Get instance property
inherited
sendInstancePropertiesGet(dynamic nativeClass) Future<Map<String, dynamic>>
Get instance properties
inherited
sendInstanceSet(String property, dynamic value) Future<void>
Set instance property
inherited
setMusicPitch(NSString musicId, int pitch) FutureOr<void>
@detail api @author lihuan.wuti2ha @brief Transposes up/down the music being played. @param musicId Music ID. @param pitch The pitch up/down value relative to the original pitch, in the range of -12, 12, with the default value of 0.
The difference in pitch between two adjacent values is a semitone. A positive value indicates an increase in pitch, and a negative value indicates a decrease in pitch. A larger absolute value means more pitch increase or decrease. @note - The music must be in the playing when you call this API. - If the set pitch is greater than 12, it will be adjusted by the maximum value of 12; if the set pitch is less than –12, it will be adjusted by the minimum value of –12. - If the music ID is invalid, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3023 and a playState of 4. - If you didn't join the room, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3022 and a playState of 4.
setMusicVolume(NSString musicId, int volume) FutureOr<void>
@detail api @author lihuan.wuti2ha @brief Sets the volume of the playing music. The music must be playing when you set the volume. @param musicId Music ID. @param volume Volume. Adjustment range: 0,400.
- 0: Mute. - 100: Original volume. - 400: 4 times the original volume (with overflow protection). @note - The music must be playing when you call this API. - If the set volume is greater than 400, it will be adjusted by the maximum value of 400; if the set volume is less than 0, it will be adjusted by the minimum value of 0. - If the music ID is invalid, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3023 and a playState of 4. - If you didn't join the room, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3022 and a playState of 4.
stopMusic(NSString musicId) FutureOr<void>
@detail api @author lihuan.wuti2ha @brief Stops playing the music. @param musicId Music ID. @note - After calling this API, you will receive the music play state through ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback. - If the music ID is invalid, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3023 and a playState of 4. - If you didn't join the room, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3022 and a playState of 4.
switchAudioTrackType(NSString musicId) FutureOr<void>
@detail api @author lihuan.wuti2ha @brief Switches the audio track type between the original track and the instrumental track. @param musicId Music ID. @note The music must be playing when you call this API.
toString() String
A string representation of this object.
inherited
updateResource(NativeResource resource) → void
inherited

Operators

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

Static Properties

codegen_$namespace → dynamic
no setter