I want to play two videos in media player.
i made the playlist and pass to media player and make player active using such cod
CODEBOX
var playlist = new KONtx.media.Playlist();
//add entries by fill the array.
var entries = [];
entries.push(new KONtx.media.PlaylistEntry({ url: url1 }));
entries.push(new KONtx.media.PlaylistEntry({ url: dreamtv_video_url }));
playlist.addEntries(entries);
KONtx.mediaplayer.playlist.set(playlist);
KONtx.mediaplayer.setConnectionBandwidth(KONtx.messages.fetch("bandwidth") || 1);
KONtx.mediaplayer.playlist.start();
Now suppose i get the media player error state from the first video because the video format is not good and the media player will not support that format video. and in such condition the control goes to this control as in codebox
CODEBOX
if(event.payload.newState === KONtx.mediaplayer.constants.states.ERROR) {
this._myLog("ERROR::An error was received from the OEM-specific media player.");
new KONtx.dialogs.Alert({
title: "ERROR::an error was received from the OEM-specific media player.",
message: "Media Player Error. Please return to Main screen.",
buttons: [
{ label: 'Return', callback: function() {
KONtx.mediaplayer.control.stop();
KONtx.application.previousView();
} }
]
}).show();
}
now from this state is there any way to start the second video quickly. i am confused. should i use KONtx.mediaplayer.playlist.nextEntry(); or KONtx.mediaplayer.playlist.loadEntry(1); or any other way? i tried with both but the media player crash!! so how can i by pass the first video in case of bad fromat?
Thanks.