diff --git a/src/display.js b/src/display.js index 4941884326191185e56723a8d55a22c9dd2bcf10..f20d6b4bc42a8d2ab99a1e0221a53b61fc96c868 100644 --- a/src/display.js +++ b/src/display.js @@ -559,6 +559,7 @@ SpiceDisplayConn.prototype.process_channel_message = function(msg) var v = document.createElement("video"); v.src = window.URL.createObjectURL(media); + v.setAttribute('muted', true); v.setAttribute('autoplay', true); v.setAttribute('width', m.stream_width); v.setAttribute('height', m.stream_height); @@ -1146,6 +1147,10 @@ function handle_append_video_buffer_done(e) stream.video.currentTime = stream.video.buffered.start(stream.video.buffered.length - 1); } + /* Modern browsers try not to auto play video. */ + if (this.stream.video.paused && this.stream.video.readyState >= 2) + var promise = this.stream.video.play(); + if (Utils.STREAM_DEBUG > 1) console.log(stream.video.currentTime + ":id " + stream.id + " updateend " + Utils.dump_media_element(stream.video)); }