createMediaPlayer

Creates an IMediaPlayer object.

virtual agora_refptr<IMediaPlayer> createMediaPlayer() = 0;

Before calling any API in IMediaPlayer, you must call this method to create an IMediaPlayer instance. If you need multiple instances, you can call this method multiple times.

Timing

You can call this method before or after joining a channel.

Return Values

  • If the method call succeeds, returns an IMediaPlayer object. See IMediaPlayer.
  • If the method call fails, returns NULL.