Working with Multi-Resolution Players on Widevine

To support ABR for video content with multiple resolutions on Google Widevine, you can set the maximum dimensions of the video stream.

To allow your multi-resolution videos to be played at maximal size on a mobile device, you can set the maximum width and height of the video stream, as shown in the code fragment below. The stream selected will have a resolution smaller or equal to the maximum dimensions you define.

  1. Extend the DefaultPlayerInfo class.

    The maxHeight and maxWidth should accommodate the highest resolution you have to serve.

  2. Set the static StreamPlayer.DefaultPlayerInfo to an instance of your new class, in the code snippet, CustomPlayerInfo.
// Android
  class CustomPlayerInfo extends DefaultPlayerInfo {
    public int getMaxWidth() { return 1200; }
    public int getMaxHeight() { return 700; }
  }

  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    StreamPlayer.defaultPlayerInfo = new CustomPlayerInfo();

    ...

    OoyalaPlayerLayoutController playerLayoutController = new OoyalaPlayerLayoutController(playerLayout, PCODE, new PlayerDomain(DOMAIN));
    ...

해당 내용이 도움 되었습니까?