ionorg / ion-sdk-js

ion javascript sdk
MIT License
102 stars 70 forks source link

[ERROR] iOS 13.5 `stream.publish()` not found #218

Closed Nealsoni00 closed 3 years ago

Nealsoni00 commented 3 years ago

NOTE: This happens on iOS 13.5, not on iOS 14+ (have not tested on any other versions of iOS. Worked on Android 7,8,9,10,11). I tested 3 different iOS 13.5 phones, all with the same issue.

Your environment.

What did you do?

Start a livestream with the ion server

What did you expect?

The livestream to go through

What happened?

The livestream didn't go through because the stream.publish() method could not be found.

ORIGINAL ERROR

image image

Discovery process:

  1. When looking into why that method is not found, I noticed while connecting the phone to safari debugger the publish method looked commented:

image

  1. Looking into when that commenting started, it happens here?

image

  1. To verify both the stream and transports are not null, I printed them below:

image

  1. Testing track.unpublish() leads to the same error

image

Nealsoni00 commented 3 years ago

This is a bug in old safari on how it handles inheretance. Adding this before the call solves the problem.

            Object.setPrototypeOf(newStream, LocalStream.prototype);