|
|
|
@ -107,14 +107,17 @@ |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
janusPluginError: function (error) { |
|
|
|
|
screenShare () { |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
janusPluginError (error) { |
|
|
|
|
console.log(error) |
|
|
|
|
}, |
|
|
|
|
consentDialog: function (on) { |
|
|
|
|
consentDialog (on) { |
|
|
|
|
// this.$janus.debug("Consent dialog should be " + (on ? "on" : "off") + " now"); |
|
|
|
|
console.log(on) |
|
|
|
|
}, |
|
|
|
|
janusPluginSuccess: function (pluginHandle) { |
|
|
|
|
janusPluginSuccess (pluginHandle) { |
|
|
|
|
this.pluginHandle = pluginHandle |
|
|
|
|
this.$janus.log("Plugin attached! (" + this.pluginHandle.getPlugin() + ", id=" + this.pluginHandle.getId() + ")"); |
|
|
|
|
this.$janus.log(" -- This is a publisher/manager"); |
|
|
|
@ -123,7 +126,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
initDevices: function (devices) { |
|
|
|
|
initDevices (devices) { |
|
|
|
|
console.log(devices) |
|
|
|
|
devices.forEach(device => { |
|
|
|
|
if (device.kind === 'videoinput') { |
|
|
|
@ -136,18 +139,18 @@ |
|
|
|
|
}) |
|
|
|
|
this.deviceSelectDialog = true |
|
|
|
|
}, |
|
|
|
|
genRemoteFeed: function () { |
|
|
|
|
genRemoteFeed () { |
|
|
|
|
this.remoteStreams.forEach(item => { |
|
|
|
|
this.createRemoteFeed(item) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
offerSend: function (jsep) { |
|
|
|
|
offerSend (jsep) { |
|
|
|
|
console.log('vid offer') |
|
|
|
|
var publish = {"request": "configure", "audio": true, "video": true}; |
|
|
|
|
|
|
|
|
|
this.pluginHandle.send({"message": publish, "jsep": jsep}); |
|
|
|
|
}, |
|
|
|
|
controlPublishers: function(msg) { |
|
|
|
|
controlPublishers(msg) { |
|
|
|
|
msg["publishers"].forEach(item => { |
|
|
|
|
var has = false |
|
|
|
|
this.remoteStreams.forEach(rm => { |
|
|
|
@ -159,7 +162,7 @@ |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
janusMessage: function (msg, jsep) { |
|
|
|
|
janusMessage (msg, jsep) { |
|
|
|
|
console.log(msg); |
|
|
|
|
var event = msg["videoroom"]; |
|
|
|
|
if (event !== undefined) { |
|
|
|
@ -194,14 +197,14 @@ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onlocalstream: function (stream) { |
|
|
|
|
onlocalstream (stream) { |
|
|
|
|
this.mystream = stream |
|
|
|
|
console.log(this.$refs) |
|
|
|
|
console.log(this.$refs["ownstream"]) |
|
|
|
|
this.$refs.ownstream.srcObject = this.mystream |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
restartDevices: function () { |
|
|
|
|
restartDevices () { |
|
|
|
|
this.deviceSelectDialog = false |
|
|
|
|
|
|
|
|
|
var media = { |
|
|
|
@ -231,17 +234,17 @@ |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
webrtcState: function (on) { |
|
|
|
|
webrtcState (on) { |
|
|
|
|
this.$janus.log("Janus says our WebRTC PeerConnection is " + (on ? "up" : "down") + " now"); |
|
|
|
|
}, |
|
|
|
|
mediaState: function (medium, on) { |
|
|
|
|
mediaState (medium, on) { |
|
|
|
|
this.$janus.log("Janus " + (on ? "started" : "stopped") + " receiving our " + medium); |
|
|
|
|
}, |
|
|
|
|
changeDevice: function () { |
|
|
|
|
changeDevice () { |
|
|
|
|
this.$refs.ownstream.setSinkId(this.selectedVideo) |
|
|
|
|
this.$refs.ownstream.setSinkId(this.selectedAudio) |
|
|
|
|
}, |
|
|
|
|
selectDevice: function () { |
|
|
|
|
selectDevice () { |
|
|
|
|
if (!this.started) { |
|
|
|
|
console.log(this.selectedVideo) |
|
|
|
|
console.log(this.selectedAudio) |
|
|
|
@ -257,7 +260,7 @@ |
|
|
|
|
this.restartDevices() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
janusSuccess: function () { |
|
|
|
|
janusSuccess () { |
|
|
|
|
this.opaqueId = "videoroomtest-" + this.$janus.randomString(12); |
|
|
|
|
|
|
|
|
|
this.janusInit.attach( |
|
|
|
|