GUIDE

GUIDE


Seamless Video Playback

.

This topic describes how to play seamless video on a device. Seamless Video playback can be done using the below methods:

Single Mode

This mode can be used when the partner wants to play a single video content in seamlessly. This can be achieved using AVPlay API.
See the Single Mode Limitations.

 webapis.avplaystore.setVideoStillMode("true"); 
// This API would keep the last frame of the video will be shown untill video starts again. 
// This is applicable if the partner wants to use 2 different videos (one after the other) using seamless playback.
webapis.avplaystore.playing.setVideoStillMode(“false") ; 
//This API would disable still mode till the time it is enabled again.

Code Example:

var player1 = webapis.avplaystore.getPlayer();
var player2 = webapis.avplaystore.getPlayer(); 

listener2 = {
    onstreamcompleted: function() {
    player2.setVideoStillMode("true");
    player2.stop();
    player1.open(“http://test.com/test1.mp4”);
    player1.setListener(Listener1);
    player1.setDisplayRect(0, 0, 1920, 1080);
    player1.prepare();
    player1.setVideoStillMode("false");
    player1.play();
};
listener1 = {
    onstreamcompleted: function() {
    player1.setVideoStillMode("true");
    player1.stop();
    player2.open(“http://test.com/test2.mp4”);
    player2.setListener(Listener2);
    player2.setDisplayRect(0, 0, 1920, 1080);
    player2.prepare();
    player2.setVideoStillMode("false");
    player2.play();
};
try
{
       player1.open(“http://test.com/test1.mp4”);
       player1.setListener(listener1);
       Player1.setDisplayRect(0, 0, 1920, 1080);
       player1.avplay.prepare();
       player1.avplay.play();
  }
 catch (e)
 {
       console.log(e);
 }


Single Mode Limitations

  • This API is supported only for http streaming (.mp4).
  • webapis.js MUST be included for Single Mode.
  • b2bavplay.js doesn’t support for Single Mode.
  • Maximum FPS supported <=60.0 FPS as comparision to MIXER mode which can play only upto 30.0 FPS.
  • MUST use same resolution and same FPS contents for seamless videos switching (Recomendation).
  • UHD seamless playback is supported using Single Mode.
  • ONLY 1 video would be displayed on the screen.

MIXER Mode:

This mode can be used when you need to play videos onto 2 separate display rectangles (simultaneously at a time) onto a single screen (1920x1080). It means there can play two playlists in seamless manner when using this mode. See the Mixer Mode Limitations

  • Maximum two videos output on one display.
  • One video frame mixed with two videos frames.
  • Only one audio allocate to the first player which is prepared first.


Figure 1:Two Video Player Instance

Figure 1:Two Video Player Instance


  • To use AVPLAY API API to call the mixer properties.
  • It enables MIXER mode in MM player.
webapis.avplaystore.SetStreamingProperty("USE_VIDEOMIXER");
 // It MUST be called before prepare(). 
webapis.avplaystore.SetStreamingProperty("SET_MIXEDFRAME"); 
// It MUST be called before play()

The below call sequence is for two video areas which can play videos in seamless mode:

Code Example for Two Video:

try {
              var player1 = webapis.avplaystore.getPlayer();
              var player2 = webapis.avplaystore.getPlayer(); 
              player1.open(url1);
              player2.open(url2);
              //listner1 can be used for switching videos in seamless manner related to playlist1.          
              player1.setListener(listener1);
             // listner2 can be used for switching videos in seamless manner related to playlist2   
              player2.setListener(listener2); 
              player1.setStreamingProperty("USE_VIDEOMIXER");
              player2.setStreamingProperty("USE_VIDEOMIXER");
              player1.setDisplayRect(0, 0, 960,540);
              player2.setDisplayRect(960,540,960,540);
              player1.prepare();
              player2.prepare();
              player1.setStreamingProperty("SET_MIXEDFRAME");
              player2.setStreamingProperty("SET_MIXEDFRAME");
              player1.play();
              player2.play();
} catch (e) {
         console.log(e);
}

Code Example for One Video:

 try {
              var player1 = webapis.avplaystore.getPlayer();
              player1.open(url1);
              player1.setListener(listener1); 
             //listener1 can be used for switching videos in seamless manner related to playlist1   
              player1.setStreamingProperty("USE_VIDEOMIXER");
              player1.setDisplayRect(0, 0, 960,540);
              player1.prepare();
              player1.setStreamingProperty("SET_MIXEDFRAME");
              player1.setDisplayRotation("PLAYER_DISPLA  Y_ROTATION_90"); //To play portrait content
              player1.play();
          } catch (e) {
         console.log(e);
}

Mixer Mode Limitations

  • This API is supported ONLY for http streaming (.mp4).
  • webapis.js MUST be included for Mixer mode.
  • b2bavplay.js doesn’t support Mixer mode.
  • Maximum FPS supported <=30.0 FPS
  • UHD content is NOT supported in MIXER mode.
  • Maximum 4 avplaystore instances can be created at a time.

위로가기