Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
themeRDark
    var options = {
        name: streamName,
        display: remoteVideo,
        flashShowFullScreenButton: true
    };
    ...
    if (autoplay) {
        options.unmutePlayOnStart = false;
    }
    stream = session.createStream(options).on(STREAM_STATUS.PENDING, function (stream) {
        ...
    });
    stream.play();

Stream publishing and playback in Low Power Mode

In Low Power Mode on iOS devices, user action is mandatory to publish or play media stream. Autoplay does not work in this mode. Use the function playFirstVideo to detect Low Power Mode: a Promise returned by the function will be rejected:

code

Code Block
languagejs
themeRDark
                if (Browser.isSafariWebRTC()) {
                    Flashphoner.playFirstVideo(pDisplay, false, PRELOADER_URL).then(function() {
                        playStream(participant, pDisplay);
                    }).catch(function (error) {
                        // Low Power Mode detected, user action is needed to start playback in this mode
                        console.log("Can't atomatically play participant" + participant.name() + " stream, use Play button");
                        onParticipantStopped(participant);
                    });
                }