Jump to content
  • 0

play_finished instantly triggered after loading

Enrico Viappiani


Hi all,

I've experienced a strange behaviour during the developing of my project.
I've modified the source of the javascript SDK tutorial that play a stream on a web page.
The tutorial works just fine, but switching to a new ant streaming server,  the play_finished event is instantly triggered.
That server is out of our control. The play code is :

var sdpConstraints = {
OfferToReceiveAudio : true,
OfferToReceiveVideo : true

var mediaConstraints = {
video : true,
audio : true

var webRTCAdaptorPnp = new WebRTCAdaptor({
websocket_url : "wss://<myserver>",
mediaConstraints : mediaConstraints,
peerconnection_config : pc_config,
sdp_constraints : sdpConstraints,
remoteVideoId : "pnpScreen",
isPlayMode: true,
callback : function(info) {
if (info == "initialized") {
} else if (info == "play_started") {
console.log("play started");
} else if (info == "play_finished") {
// play finishedthe stream
console.log("play finished");
callbackError : function(error) {
//some of the possible errors, NotFoundError, SecurityError,PermissionDeniedError

console.log("error callback: " + error);

We also tried with the iOS SDK and it is working.. any clues?


Link to comment
Share on other sites

  • Answers 4
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

4 answers to this question

Recommended Posts

  • 0

Hi Enrico,

Have a good day. As I see, you need to set mediaConstraints as below:

var mediaConstraints = {

video : false,

audio : false


It's hard to understand real cause of problem with limited code snippets.

We need to check full of HTML page. Could you please share your live page with support@antmedia.io?

Best Regards,


Link to comment
Share on other sites


  • Create New...