Player start muted

Max

Administrator
Staff member
Good day.
Due to autoplay policy in a most of modern browsers, you should emulate some user action to automatically play video with sound. For e[ample, click on volume slider:
Code:
function playStream(session) { 
    ...
    stream = session.createStream(options).on(STREAM_STATUS.PENDING, function(stream) {
        var video = document.getElementById(stream.id());
        if (!video.hasListeners) {
            video.hasListeners = true;
            video.addEventListener('playing', function () {
                ...
                if (autoplay && stream.isRemoteAudioMuted()) {
                    //WCS-1698. if autoplay = true, then set the volume slider to 0. When you first click on the slider or icon, sound turn on. https://goo.gl/7K7WLu
                    $('.volume').click();
                    $('.volume').bind('click', volumeEvent);
                    $('.volume-range-block').bind('mousedown', volumeEvent);
                }
                if ($('.volume').hasClass('volume-none') && !stream.isRemoteAudioMuted()) {
                    $('.volume').click();
                }
            });
            ...
        }
    }).on(STREAM_STATUS.PLAYING, function (stream) {
        ...
    });
    stream.play();
}

function volumeEvent(event) {
    stream.unmuteRemoteAudio();
    $('.volume').unbind('click',volumeEvent);
    $('.volume-range-block').unbind('mousedown',volumeEvent);
}
 
But the issue happens on this way:

1-) Publisher start transmission
2-) Viewer join the page and open player
3-) It starts with audio and video OK
4-) Publisher stop their transmission
5-) Publisher start again transmission
6-) Viewer click on PLAY .. its become muted audio.
 

Max

Administrator
Staff member
Good day.
We cannot reproduce the issue neither with Player nor Embed Player examples. Please check if stream is not muted on publisher side. Also please provide us Player code example with minimal modifications to reproduce the issue.
 
Top