setPlayerOption [2/2]

Sets parameter options for the media player.

virtual int setPlayerOption(const char* key, const char* value) = 0;

This method sets parameter options for the media player using key and value. Unlike setPlayerOption(const char* key, int value), the value parameter in this method is a string, whereas in the other method it is an integer. These two methods cannot be used simultaneously. In general, you do not need to call this method and can use the default parameters provided by the media player.

Scenario

Applicable to scenarios requiring technical preview or special customization features.

Timing

Call this method before calling the open or openWithMediaSource method.

Parameters

key
Key of the parameter option.
value
Value of the parameter option.

Return Values

  • 0: Success.
  • < 0: Failure.