setMusicTrack abstract method

void setMusicTrack(
  1. int id,
  2. int trackIndex
)

Specify the Playback Track of Background Music

This API allows you to specify which track of the background music to play.

  • Parameters:
    • id(int):
      • Music ID.
    • index(int):
      • Specify which track to play (the first track is played by default). Value range: [0, total number of tracks).

Note: The total number of tracks can be obtained through the getMusicTrackCount interface.

Implementation

void setMusicTrack(int id, int trackIndex);