fix srcobject

master
Mustafa Yontar 5 years ago
parent 7d4dc9b63d
commit ca00e32800
  1. 12
      src/lib/RemoteFeed.vue

@ -36,7 +36,7 @@
}), }),
watch: { watch: {
volume (old, newVal) { volume (old, newVal) {
console.log(parseFloat(newVal) * 0.01)
this.$refs.feed_video.volume = parseFloat(newVal) * 0.01 this.$refs.feed_video.volume = parseFloat(newVal) * 0.01
} }
}, },
@ -79,8 +79,16 @@
}, },
onStream (stream) { onStream (stream) {
console.log('stream is strarted') 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) setInterval(this.feedInterval,1000)
}, },
feedInterval () { feedInterval () {