From ca00e3280071d004f31bbc52448cdd7240457cff Mon Sep 17 00:00:00 2001 From: Mustafa Yontar Date: Sat, 11 Apr 2020 01:11:25 +0300 Subject: [PATCH] fix srcobject --- src/lib/RemoteFeed.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lib/RemoteFeed.vue b/src/lib/RemoteFeed.vue index 774e66b..81354c4 100644 --- a/src/lib/RemoteFeed.vue +++ b/src/lib/RemoteFeed.vue @@ -36,7 +36,7 @@ }), watch: { volume (old, newVal) { - console.log(parseFloat(newVal) * 0.01) + this.$refs.feed_video.volume = parseFloat(newVal) * 0.01 } }, @@ -79,8 +79,16 @@ }, onStream (stream) { console.log('stream is strarted') + if (this.$refs.feed_video) { + try { + this.$refs.feed_video.srcObject = stream + } catch (e) { - this.$refs.feed_video.srcObject = stream + this.$refs.feed_video.src = URL.createObjectURL(stream) + } + } else { + console.log(this.$refs.feed_video) + } setInterval(this.feedInterval,1000) }, feedInterval () {