|
|
@ -1,5 +1,6 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<v-container> |
|
|
|
<v-container> |
|
|
|
|
|
|
|
<v-btn @click="deviceSelectDialog = true">change</v-btn> |
|
|
|
<v-dialog |
|
|
|
<v-dialog |
|
|
|
v-model="deviceSelectDialog" |
|
|
|
v-model="deviceSelectDialog" |
|
|
|
max-width="290" |
|
|
|
max-width="290" |
|
|
@ -17,6 +18,7 @@ |
|
|
|
item-value="deviceId" |
|
|
|
item-value="deviceId" |
|
|
|
item-text="label" |
|
|
|
item-text="label" |
|
|
|
></v-select> |
|
|
|
></v-select> |
|
|
|
|
|
|
|
<v-checkbox label="No Video" v-model="noVid"></v-checkbox> |
|
|
|
</v-col> |
|
|
|
</v-col> |
|
|
|
<v-col md="12" cols="12"> |
|
|
|
<v-col md="12" cols="12"> |
|
|
|
<v-select |
|
|
|
<v-select |
|
|
@ -51,7 +53,6 @@ |
|
|
|
</v-card-actions> |
|
|
|
</v-card-actions> |
|
|
|
</v-card> |
|
|
|
</v-card> |
|
|
|
</v-dialog> |
|
|
|
</v-dialog> |
|
|
|
<v-btn @click="genRemoteFeed">Remote Feed</v-btn> |
|
|
|
|
|
|
|
<v-row> |
|
|
|
<v-row> |
|
|
|
<v-col cols="12" md="3"> |
|
|
|
<v-col cols="12" md="3"> |
|
|
|
<video ref="ownstream" class="rounded centered" id="myvideo" width="100%" height="100%" autoplay |
|
|
|
<video ref="ownstream" class="rounded centered" id="myvideo" width="100%" height="100%" autoplay |
|
|
@ -65,8 +66,6 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import RemoteFeed from "@/lib/RemoteFeed"; |
|
|
|
import RemoteFeed from "@/lib/RemoteFeed"; |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
components: {RemoteFeed}, |
|
|
|
components: {RemoteFeed}, |
|
|
@ -85,9 +84,11 @@ |
|
|
|
mypvtid: '', |
|
|
|
mypvtid: '', |
|
|
|
selectedVideo: null, |
|
|
|
selectedVideo: null, |
|
|
|
selectedAudio: null, |
|
|
|
selectedAudio: null, |
|
|
|
|
|
|
|
started: false, |
|
|
|
videoDevices: [], |
|
|
|
videoDevices: [], |
|
|
|
audioDevices: [], |
|
|
|
audioDevices: [], |
|
|
|
deviceSelectDialog: false, |
|
|
|
deviceSelectDialog: false, |
|
|
|
|
|
|
|
noVid: false, |
|
|
|
remoteStreams: [] |
|
|
|
remoteStreams: [] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -159,11 +160,8 @@ |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
janusMessage: function (msg, jsep) { |
|
|
|
janusMessage: function (msg, jsep) { |
|
|
|
// this.$janus.debug(" ::: Got a message (publisher) :::"); |
|
|
|
|
|
|
|
console.log(msg); |
|
|
|
console.log(msg); |
|
|
|
// this.$janus.debug(jsep); |
|
|
|
|
|
|
|
var event = msg["videoroom"]; |
|
|
|
var event = msg["videoroom"]; |
|
|
|
// this.$janus.debug("Event: " + event); |
|
|
|
|
|
|
|
if (event !== undefined) { |
|
|
|
if (event !== undefined) { |
|
|
|
if (event === "joined") { |
|
|
|
if (event === "joined") { |
|
|
|
this.myid = msg["id"]; |
|
|
|
this.myid = msg["id"]; |
|
|
@ -174,7 +172,6 @@ |
|
|
|
this.controlPublishers(msg) |
|
|
|
this.controlPublishers(msg) |
|
|
|
} |
|
|
|
} |
|
|
|
} else if(event === "event") { |
|
|
|
} else if(event === "event") { |
|
|
|
// Any new feed to attach to? |
|
|
|
|
|
|
|
if (msg["publishers"] !== undefined && msg["publishers"] !== null) { |
|
|
|
if (msg["publishers"] !== undefined && msg["publishers"] !== null) { |
|
|
|
this.controlPublishers(msg) |
|
|
|
this.controlPublishers(msg) |
|
|
|
|
|
|
|
|
|
|
@ -193,15 +190,11 @@ |
|
|
|
this.pluginHandle.handleRemoteJsep({jsep: jsep}); |
|
|
|
this.pluginHandle.handleRemoteJsep({jsep: jsep}); |
|
|
|
var audio = msg["audio_codec"]; |
|
|
|
var audio = msg["audio_codec"]; |
|
|
|
if (this.mystream && this.mystream.getAudioTracks() && this.mystream.getAudioTracks().length > 0 && !audio) { |
|
|
|
if (this.mystream && this.mystream.getAudioTracks() && this.mystream.getAudioTracks().length > 0 && !audio) { |
|
|
|
// Audio has been rejected |
|
|
|
|
|
|
|
//toastr.warning("Our audio stream has been rejected, viewers won't hear us"); |
|
|
|
|
|
|
|
console.log("Our audio stream has been rejected, viewers won't hear us"); |
|
|
|
console.log("Our audio stream has been rejected, viewers won't hear us"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
onlocalstream: function (stream) { |
|
|
|
onlocalstream: function (stream) { |
|
|
|
// this.$janus.debug(" ::: Got a local stream :::"); |
|
|
|
|
|
|
|
// this.$janus.debug(stream); |
|
|
|
|
|
|
|
this.mystream = stream |
|
|
|
this.mystream = stream |
|
|
|
console.log(this.$refs) |
|
|
|
console.log(this.$refs) |
|
|
|
console.log(this.$refs["ownstream"]) |
|
|
|
console.log(this.$refs["ownstream"]) |
|
|
@ -212,7 +205,7 @@ |
|
|
|
this.deviceSelectDialog = false |
|
|
|
this.deviceSelectDialog = false |
|
|
|
|
|
|
|
|
|
|
|
var media = { |
|
|
|
var media = { |
|
|
|
audioRecv: false, videoRecv: false, audioSend: true, videoSend: true, |
|
|
|
audioRecv: false, videoRecv: false, audioSend: true, videoSend: !this.noVid, |
|
|
|
audio: { |
|
|
|
audio: { |
|
|
|
deviceId: { |
|
|
|
deviceId: { |
|
|
|
exact: this.selectedAudio |
|
|
|
exact: this.selectedAudio |
|
|
@ -244,14 +237,25 @@ |
|
|
|
mediaState: function (medium, on) { |
|
|
|
mediaState: function (medium, on) { |
|
|
|
this.$janus.log("Janus " + (on ? "started" : "stopped") + " receiving our " + medium); |
|
|
|
this.$janus.log("Janus " + (on ? "started" : "stopped") + " receiving our " + medium); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
changeDevice: function () { |
|
|
|
|
|
|
|
this.$refs.ownstream.setSinkId(this.selectedVideo) |
|
|
|
|
|
|
|
this.$refs.ownstream.setSinkId(this.selectedAudio) |
|
|
|
|
|
|
|
}, |
|
|
|
selectDevice: function () { |
|
|
|
selectDevice: function () { |
|
|
|
|
|
|
|
if (!this.started) { |
|
|
|
console.log(this.selectedVideo) |
|
|
|
console.log(this.selectedVideo) |
|
|
|
console.log(this.selectedAudio) |
|
|
|
console.log(this.selectedAudio) |
|
|
|
// this.$refs.ownstream.setSinkId(this.selectedVideo) |
|
|
|
this.started = true |
|
|
|
// this.$refs.ownstream.setSinkId(this.selectedAudio) |
|
|
|
var register = { |
|
|
|
|
|
|
|
"request": "join", |
|
|
|
var register = {"request": "join", "room": this.room, "ptype": "publisher", "display": this.username}; |
|
|
|
"room": this.room, |
|
|
|
|
|
|
|
"ptype": "publisher", |
|
|
|
|
|
|
|
"display": this.username |
|
|
|
|
|
|
|
}; |
|
|
|
this.pluginHandle.send({"message": register}); |
|
|
|
this.pluginHandle.send({"message": register}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.restartDevices() |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
janusSuccess: function () { |
|
|
|
janusSuccess: function () { |
|
|
|
this.opaqueId = "videoroomtest-" + this.$janus.randomString(12); |
|
|
|
this.opaqueId = "videoroomtest-" + this.$janus.randomString(12); |
|
|
|