0๐
I believe you could use $refs, something like
<video ref="tokboxVideo" />
then
mounted() {
this.$refs.tokboxVideo.srcObject = this.tokboxVideoElementCreated;
}
0๐
You might have better success with the streamCreated
event on the session. Create a Subscriber
component like below:
<template>
<div>
</div>
</template>
<script>
import OT from '@opentok/client';
export default {
name: 'subscriber',
props: {
stream: {
type: OT.Stream,
required: true
},
session: {
type: OT.Session,
required: true
},
opts: {
type: Object,
required: false
}
},
mounted: function() {
const subscriber = this.session.subscribe(
this.stream,
this.$el,
this.opts,
err => {
if (err) {
this.$emit('error', err);
} else {
this.$emit('subscriberConnected', subscriber);
}
}
);
this.$emit('subscriberCreated', subscriber);
}
};
</script>
This will insert the video element inside the component. Then you can control how the component is displayed in your app.
Check out the basic vue sample in our repos.
- [Vuejs]-What is the best way to build an api for huge list and retrieve it via vuejs
- [Vuejs]-Firebase db with vuejs : default.collection is not a function
Source:stackexchange.com