Some hls livestreams not prepared by webapis.avplay.prepareAsync()

Hey All,

Recently I’ve run into trouble with supporting livestreams on the tizen avplay video player. Some livestreams such as

https://cbsn-us.cbsnstream.cbsnews.com/out/v1/55a8648e8f134e82a470f83d562deeca/master_11.m3u8

work fine, while other livestreams such as

https://gideommd.mmdlive.lldns.net/gideommd/543df477273b4e4f9baa8eef475dddca/manifest.m3u8

don’t work at all.

in fact, the behavior that the latter live stream exhibits when being loaded into the video player is strange. The prepare() method just crashes and the prepareAsync(successCallback, errorCallback) begins to execute but never calls either callback and doesn’t log any information. I’ve tested on my app as well as two other sample apps that are only meant to showcase the avplay code, so I don’t think it’s an issue with my code, it’s probably something with the stream, but I can’t figure out exactly what it is and how to avoid it.

Is there anyway you could test with those two streams and let me know what you figure out, or if you can’t test if you have any advice as to how to fix? Not sure how to handle this in the app when the success and error callback are never called from within prepareAsync(). There is no error when using open() or prepareAsync() but the success callback doesn’t execute and video buffering never starts. Obviously i can’t change what happens in the prepareAsync() code, but more information would be nice.

Note: the stream i supplied that isn’t working is also a church live stream, so it might not be live when you’re testing. if that’s the case, let me know and i can get a dummy test up so you can see what I mean.

Here is my code for reference:

/* this is never called on some streams for some reason but works perfectly with others*/

function successCallback() {

console.log("prepare entered")

letBitRateString = "BITRATES=1000~10000|STARTBITRATE=LOWEST|SKIPBITRATE=LOWEST|STARTFRAGMENT=0";

global.webapis.avplay.setStreamingProperty("ADAPTIVE_INFO", BitRateString);

console.log("set streaming prop")

global.webapis.avplay.setDisplayMethod("PLAYER_DISPLAY_MODE_FULL_SCREEN");

console.log("set display method")

console.log("prepared")

global.webapis.avplay.play();

letText = 'AVAILABLE_BITRATE: ' + global.webapis.avplay.getStreamingProperty ("AVAILABLE_BITRATE") ;

Text += 'CURRENT_BANDWIDTH: ' + global.webapis.avplay.getStreamingProperty ("CURRENT_BANDWIDTH") + '';

Text += 'IS_LIVE: ' + global.webapis.avplay.getStreamingProperty ("IS_LIVE") +'';

lettemp = global.webapis.avplay.getStreamingProperty ("IS_LIVE");

console.log(Text);

console.log(temp);

setIsLive(temp === "0" ? false : true);

setKey(Math.random());

}

function errorCallback() {

console.log('The media has failed to prepare');

}

global.webapis.avplay.open(url);

global.webapis.avplay.setListener(listener);

console.log("added listener")

global.webapis.avplay.prepareAsync(successCallback,errorCallback);

I figured it out.

The hls stream that was causing the prepareAsync() method to hang was sending initial resolutions lower than HD. Once we upped the profile to only send HD (1280x720) and FHD (1920x1080) this mysterious error stopped happening.

1 Like

Could you share more details about how you fixed this issue? I’m facing the same problem with certain livestreams where prepareAsync neither succeeds nor fails, but just hangs. You mentioned it was resolved by sending only HD (1280x720) and FHD (1920x1080) streams - could you explain how you implemented this change? Was it done through manifest modification or server-side configuration? Any specific settings or code snippets would be really helpful as I’m not sure how to approach this fix. Thanks!

Yes it was a server-side configuration. In our stream delivery software there was an option to set the resolution of the stream to HD and FHD (before this it was set to 360 or something like that). For some reason this fixed the issue for us and the code worked on the app as it should. I can try to get more information about the specific type of stream delivery software we used if you’d like?