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);
}