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 1ee851a..4345b51 100644 --- a/src/lib/VueJanus.vue +++ b/src/lib/VueJanus.vue @@ -13,8 +13,11 @@ 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 + @@ -203,6 +206,9 @@ }, methods: { + stopSharePdf(){ + this.sharePdf=false; + }, webrtcState (on) { this.pluginHandle.send({"message": { "request": "configure", "bitrate": 512*1000 }}); console.log(on, "webrt")