diff --git a/src/lib/PdfShare.vue b/src/lib/PdfShare.vue
index 88ae936..2e3cb0c 100644
--- a/src/lib/PdfShare.vue
+++ b/src/lib/PdfShare.vue
@@ -15,6 +15,11 @@
mdi-chevron-left
{{pageNumber}} / {{pdf.numPages}}
mdi-chevron-right
+
+
+ stop pdf share
+
+
@@ -31,6 +36,7 @@ export default {
name: "PdfShare",
props: {
janusInit: Object,
+ onstop: Function,
username: String,
myrivid: Number,
room: Number,
@@ -95,6 +101,21 @@ export default {
pluginHandle.send({"message": register});
},
+ stop(){
+ var unpublish = { "request": "unpublish"};
+ this.pluginHandle.send({"message": unpublish});
+
+ this.pluginHandle.detach();
+
+ // reset
+ this.pluginHandle = null;
+ this.pdf = null;
+ this.pageNumber = 1;
+ this.loading = true;
+
+ // callback
+ this.onstop();
+ },
janusPluginError (error) {
console.log('error', error)
},
diff --git a/src/lib/VueJanus.vue b/src/lib/VueJanus.vue
index 9ae7fdd..e68bead 100644
--- a/src/lib/VueJanus.vue
+++ b/src/lib/VueJanus.vue
@@ -6,11 +6,11 @@
stop screen share
share a pdf
-
+
Share whole screen or a window?
@@ -19,13 +19,16 @@
Firefox handles screensharing in a different way: are you going to share the whole screen, or would you rather pick a single window/application to share instead?
+
Share a screen
+
Share a window
+
Chrome Extension Error
@@ -155,6 +158,9 @@
},
methods: {
+ stopSharePdf(){
+ this.sharePdf=false;
+ },
webrtcState (on) {
this.pluginHandle.send({"message": { "request": "configure", "bitrate": 512*1000 }});
console.log(on, "webrt")
@@ -191,6 +197,8 @@
}
},
onlocalstreamScreen (stream) {
+ if(!this.screenShareStarted)
+ this.screenShareStarted=true;
this.$refs.ownstreamscreen.srcObject = stream
},
shareScreenStart (capture) {
@@ -208,7 +216,6 @@
onlocalstream: this.onlocalstreamScreen
}
)
- this.screenShareStarted=true;
},
screenShareStop(){
var srcObject=this.$refs.ownstreamscreen.srcObject;