Finalized migration of camera and sound plugins

This commit is contained in:
Fabio Manganiello 2021-02-17 01:02:47 +01:00
parent ca2fd60950
commit 51de11da25
25 changed files with 117 additions and 13 deletions

View file

@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>platypush</title><link href="/static/css/chunk-12dc74e9.505ac0f9.css" rel="prefetch"><link href="/static/css/chunk-13b07ca5.029dd736.css" rel="prefetch"><link href="/static/css/chunk-1653b664.5b949e24.css" rel="prefetch"><link href="/static/css/chunk-23726328.7e460329.css" rel="prefetch"><link href="/static/css/chunk-2ca39dde.efa1eae8.css" rel="prefetch"><link href="/static/css/chunk-2f304dee.a8a2d99a.css" rel="prefetch"><link href="/static/css/chunk-487896e7.b7730bd4.css" rel="prefetch"><link href="/static/css/chunk-49211740.43a25f0f.css" rel="prefetch"><link href="/static/css/chunk-49531d8d.fc36911d.css" rel="prefetch"><link href="/static/css/chunk-4dae396b.92b3713e.css" rel="prefetch"><link href="/static/css/chunk-5145872a.197de139.css" rel="prefetch"><link href="/static/css/chunk-595ffc05.678c9c97.css" rel="prefetch"><link href="/static/css/chunk-64076603.e451beea.css" rel="prefetch"><link href="/static/css/chunk-675c7703.75b51be7.css" rel="prefetch"><link href="/static/css/chunk-792fd41e.4d467174.css" rel="prefetch"><link href="/static/css/chunk-7fae0422.c233115f.css" rel="prefetch"><link href="/static/css/chunk-d22da0c0.7c71cffb.css" rel="prefetch"><link href="/static/css/chunk-d28a86c4.cdd32c08.css" rel="prefetch"><link href="/static/css/chunk-da9476ec.f1965e2d.css" rel="prefetch"><link href="/static/css/chunk-ee62c128.44bbe779.css" rel="prefetch"><link href="/static/css/chunk-f8a20d76.8a0131ad.css" rel="prefetch"><link href="/static/js/chunk-12dc74e9.a7799079.js" rel="prefetch"><link href="/static/js/chunk-13b07ca5.11833bcd.js" rel="prefetch"><link href="/static/js/chunk-1653b664.4bba37ff.js" rel="prefetch"><link href="/static/js/chunk-23726328.7a638dfb.js" rel="prefetch"><link href="/static/js/chunk-2ca39dde.bfb67629.js" rel="prefetch"><link href="/static/js/chunk-2d0aa612.2338a00b.js" rel="prefetch"><link href="/static/js/chunk-2d0b270c.82d7f897.js" rel="prefetch"><link href="/static/js/chunk-2d0c1eb0.2fc91e77.js" rel="prefetch"><link href="/static/js/chunk-2d0c229a.c6f13c92.js" rel="prefetch"><link href="/static/js/chunk-2d0cc2be.71e3fcd8.js" rel="prefetch"><link href="/static/js/chunk-2d0d5f97.57d7afa3.js" rel="prefetch"><link href="/static/js/chunk-2d0da3df.99de332b.js" rel="prefetch"><link href="/static/js/chunk-2d208116.4f67ac14.js" rel="prefetch"><link href="/static/js/chunk-2d2091df.90a98553.js" rel="prefetch"><link href="/static/js/chunk-2d21b0dc.465e6abf.js" rel="prefetch"><link href="/static/js/chunk-2d21da1a.707bd994.js" rel="prefetch"><link href="/static/js/chunk-2d231217.5ff519da.js" rel="prefetch"><link href="/static/js/chunk-2d237d41.b4b87abb.js" rel="prefetch"><link href="/static/js/chunk-2f304dee.649e4dc7.js" rel="prefetch"><link href="/static/js/chunk-487896e7.69cdcafb.js" rel="prefetch"><link href="/static/js/chunk-49211740.e4dea096.js" rel="prefetch"><link href="/static/js/chunk-49531d8d.1ccab0d9.js" rel="prefetch"><link href="/static/js/chunk-4dae396b.0ee6bb40.js" rel="prefetch"><link href="/static/js/chunk-5145872a.f0bd0577.js" rel="prefetch"><link href="/static/js/chunk-595ffc05.8affd7fe.js" rel="prefetch"><link href="/static/js/chunk-64076603.2c344ed9.js" rel="prefetch"><link href="/static/js/chunk-675c7703.7c7378cd.js" rel="prefetch"><link href="/static/js/chunk-792fd41e.aca41198.js" rel="prefetch"><link href="/static/js/chunk-7fae0422.0d9be069.js" rel="prefetch"><link href="/static/js/chunk-d22da0c0.da01e99e.js" rel="prefetch"><link href="/static/js/chunk-d28a86c4.d0c1f74e.js" rel="prefetch"><link href="/static/js/chunk-da9476ec.f8c15985.js" rel="prefetch"><link href="/static/js/chunk-ee62c128.c11fb53e.js" rel="prefetch"><link href="/static/js/chunk-f8a20d76.70a12fd2.js" rel="prefetch"><link href="/static/css/app.a835db3a.css" rel="preload" as="style"><link href="/static/css/chunk-vendors.5dad8b00.css" rel="preload" as="style"><link href="/static/js/app.fe071759.js" rel="preload" as="script"><link href="/static/js/chunk-vendors.948dc2e5.js" rel="preload" as="script"><link href="/static/css/chunk-vendors.5dad8b00.css" rel="stylesheet"><link href="/static/css/app.a835db3a.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but platypush doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/static/js/chunk-vendors.948dc2e5.js"></script><script src="/static/js/app.fe071759.js"></script></body></html>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>platypush</title><link href="/static/css/chunk-12dc74e9.505ac0f9.css" rel="prefetch"><link href="/static/css/chunk-13b07ca5.029dd736.css" rel="prefetch"><link href="/static/css/chunk-1653b664.5b949e24.css" rel="prefetch"><link href="/static/css/chunk-23726328.7e460329.css" rel="prefetch"><link href="/static/css/chunk-2ca39dde.efa1eae8.css" rel="prefetch"><link href="/static/css/chunk-2f304dee.a8a2d99a.css" rel="prefetch"><link href="/static/css/chunk-42afd16f.3adf876e.css" rel="prefetch"><link href="/static/css/chunk-487896e7.b7730bd4.css" rel="prefetch"><link href="/static/css/chunk-49211740.43a25f0f.css" rel="prefetch"><link href="/static/css/chunk-4dae396b.92b3713e.css" rel="prefetch"><link href="/static/css/chunk-5145872a.197de139.css" rel="prefetch"><link href="/static/css/chunk-5371f448.0715d0ea.css" rel="prefetch"><link href="/static/css/chunk-5766fd9f.8a0131ad.css" rel="prefetch"><link href="/static/css/chunk-595ffc05.678c9c97.css" rel="prefetch"><link href="/static/css/chunk-64076603.e451beea.css" rel="prefetch"><link href="/static/css/chunk-675c7703.75b51be7.css" rel="prefetch"><link href="/static/css/chunk-792fd41e.4d467174.css" rel="prefetch"><link href="/static/css/chunk-7fae0422.c233115f.css" rel="prefetch"><link href="/static/css/chunk-d22da0c0.7c71cffb.css" rel="prefetch"><link href="/static/css/chunk-d28a86c4.cdd32c08.css" rel="prefetch"><link href="/static/css/chunk-da9476ec.f1965e2d.css" rel="prefetch"><link href="/static/css/chunk-ee62c128.44bbe779.css" rel="prefetch"><link href="/static/js/chunk-12dc74e9.a7799079.js" rel="prefetch"><link href="/static/js/chunk-13b07ca5.11833bcd.js" rel="prefetch"><link href="/static/js/chunk-1653b664.4bba37ff.js" rel="prefetch"><link href="/static/js/chunk-23726328.7a638dfb.js" rel="prefetch"><link href="/static/js/chunk-2ca39dde.bfb67629.js" rel="prefetch"><link href="/static/js/chunk-2d0aa612.2338a00b.js" rel="prefetch"><link href="/static/js/chunk-2d0b270c.82d7f897.js" rel="prefetch"><link href="/static/js/chunk-2d0c1eb0.2fc91e77.js" rel="prefetch"><link href="/static/js/chunk-2d0c229a.c6f13c92.js" rel="prefetch"><link href="/static/js/chunk-2d0cc2be.71e3fcd8.js" rel="prefetch"><link href="/static/js/chunk-2d0d5f97.57d7afa3.js" rel="prefetch"><link href="/static/js/chunk-2d0da3df.99de332b.js" rel="prefetch"><link href="/static/js/chunk-2d208116.4f67ac14.js" rel="prefetch"><link href="/static/js/chunk-2d2091df.90a98553.js" rel="prefetch"><link href="/static/js/chunk-2d21b0dc.465e6abf.js" rel="prefetch"><link href="/static/js/chunk-2d21da1a.707bd994.js" rel="prefetch"><link href="/static/js/chunk-2d231217.5ff519da.js" rel="prefetch"><link href="/static/js/chunk-2d237d41.b4b87abb.js" rel="prefetch"><link href="/static/js/chunk-2f304dee.649e4dc7.js" rel="prefetch"><link href="/static/js/chunk-42afd16f.cd1925a7.js" rel="prefetch"><link href="/static/js/chunk-487896e7.69cdcafb.js" rel="prefetch"><link href="/static/js/chunk-49211740.e4dea096.js" rel="prefetch"><link href="/static/js/chunk-4dae396b.0ee6bb40.js" rel="prefetch"><link href="/static/js/chunk-5145872a.f0bd0577.js" rel="prefetch"><link href="/static/js/chunk-5371f448.f41bdcf2.js" rel="prefetch"><link href="/static/js/chunk-5766fd9f.bcd7e62c.js" rel="prefetch"><link href="/static/js/chunk-595ffc05.8affd7fe.js" rel="prefetch"><link href="/static/js/chunk-64076603.2c344ed9.js" rel="prefetch"><link href="/static/js/chunk-675c7703.7c7378cd.js" rel="prefetch"><link href="/static/js/chunk-792fd41e.aca41198.js" rel="prefetch"><link href="/static/js/chunk-7fae0422.0d9be069.js" rel="prefetch"><link href="/static/js/chunk-d22da0c0.da01e99e.js" rel="prefetch"><link href="/static/js/chunk-d28a86c4.d0c1f74e.js" rel="prefetch"><link href="/static/js/chunk-da9476ec.f8c15985.js" rel="prefetch"><link href="/static/js/chunk-ee62c128.c11fb53e.js" rel="prefetch"><link href="/static/css/app.a835db3a.css" rel="preload" as="style"><link href="/static/css/chunk-vendors.5dad8b00.css" rel="preload" as="style"><link href="/static/js/app.ab6d3528.js" rel="preload" as="script"><link href="/static/js/chunk-vendors.948dc2e5.js" rel="preload" as="script"><link href="/static/css/chunk-vendors.5dad8b00.css" rel="stylesheet"><link href="/static/css/app.a835db3a.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but platypush doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/static/js/chunk-vendors.948dc2e5.js"></script><script src="/static/js/app.ab6d3528.js"></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,2 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-42afd16f"],{"7b41":function(e,t,n){"use strict";n("ed57")},dbf7:function(e,t,n){"use strict";n.r(t);var r=n("7a23"),c=Object(r["K"])("data-v-30d09191");Object(r["u"])("data-v-30d09191");var o={class:"sound"},a={class:"sound-container"},s={key:0,autoplay:"",preload:"none",ref:"player"},i=Object(r["g"])(" Your browser does not support audio elements "),u={class:"controls"},d=Object(r["h"])("i",{class:"fa fa-play"},null,-1),b=Object(r["g"])("  Start streaming audio "),p=Object(r["h"])("i",{class:"fa fa-stop"},null,-1),l=Object(r["g"])("  Stop streaming audio ");Object(r["s"])();var f=c((function(e,t,n,c,f,j){return Object(r["r"])(),Object(r["e"])("div",o,[Object(r["h"])("div",a,[f.recording?(Object(r["r"])(),Object(r["e"])("audio",s,[Object(r["h"])("source",{src:"/sound/stream?t=".concat((new Date).getTime()),type:"audio/x-wav;codec=pcm"},null,8,["src"]),i],512)):Object(r["f"])("",!0)]),Object(r["h"])("div",u,[f.recording?(Object(r["r"])(),Object(r["e"])("button",{key:1,type:"button",onClick:t[2]||(t[2]=function(){return j.stopRecording.apply(j,arguments)})},[p,l])):(Object(r["r"])(),Object(r["e"])("button",{key:0,type:"button",onClick:t[1]||(t[1]=function(){return j.startRecording.apply(j,arguments)})},[d,b]))])])})),j=(n("96cf"),n("1da1")),O=n("3e54"),g={name:"Sound",mixins:[O["a"]],data:function(){return{recording:!1}},methods:{startRecording:function(){this.recording=!0},stopRecording:function(){var e=this;return Object(j["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.recording=!1,t.next=3,e.request("sound.stop_recording");case 3:case"end":return t.stop()}}),t)})))()}}};n("7b41");g.render=f,g.__scopeId="data-v-30d09191";t["default"]=g},ed57:function(e,t,n){}}]);
//# sourceMappingURL=chunk-42afd16f.cd1925a7.js.map

View file

@ -0,0 +1 @@
{"version":3,"sources":["webpack:///./src/components/panels/Sound/Index.vue?c6d2","webpack:///./src/components/panels/Sound/Index.vue","webpack:///./src/components/panels/Sound/Index.vue?ce52"],"names":["class","autoplay","preload","ref","recording","src","Date","getTime","type","stopRecording","startRecording","name","mixins","Utils","data","methods","this","request","render","__scopeId"],"mappings":"kHAAA,W,sICCOA,MAAM,S,GACJA,MAAM,mB,SACFC,SAAA,GAASC,QAAQ,OAAOC,IAAI,U,iBAEuD,kD,GAKvFH,MAAM,Y,EAEP,eAA0B,KAAvBA,MAAM,cAAY,S,iBAAK,4B,EAI1B,eAA0B,KAAvBA,MAAM,cAAY,S,iBAAK,2B,wEAfhC,eAkBM,MAlBN,EAkBM,CAjBJ,eAMM,MANN,EAMM,CAL8C,EAAAI,W,iBAAlD,eAIQ,QAJR,EAIQ,CAFN,eAAwF,UAA/EC,IAAG,+BAA0BC,MAAQC,WAAaC,KAAK,yB,iDAKpE,eAQM,MARN,EAQM,CAPiD,EAAAJ,W,iBAIrD,eAES,U,MAFDI,KAAK,SAAU,QAAK,8BAAE,EAAAC,cAAA,sB,CAC5B,E,uBALF,eAES,U,MAFDD,KAAK,SAAU,QAAK,8BAAE,EAAAE,eAAA,sB,CAC5B,E,gDAaO,GACbC,KAAM,QACNC,OAAQ,CAACC,EAAA,MAETC,KAJa,WAKX,MAAO,CACLV,WAAW,IAIfW,QAAS,CACPL,eADO,WAELM,KAAKZ,WAAY,GAGbK,cALC,WAKe,+JACpB,EAAKL,WAAY,EADG,SAEd,EAAKa,QAAQ,wBAFC,gD,UCnC1B,EAAOC,OAAS,EAChB,EAAOC,UAAY,kBAEJ,gB","file":"static/js/chunk-42afd16f.cd1925a7.js","sourcesContent":["export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Index.vue?vue&type=style&index=0&id=30d09191&lang=scss&scoped=true\"","<template>\n <div class=\"sound\">\n <div class=\"sound-container\">\n <audio autoplay preload=\"none\" ref=\"player\" v-if=\"recording\">\n <!--suppress HtmlUnknownTarget -->\n <source :src=\"`/sound/stream?t=${(new Date()).getTime()}`\" type=\"audio/x-wav;codec=pcm\">\n Your browser does not support audio elements\n </audio>\n </div>\n\n <div class=\"controls\">\n <button type=\"button\" @click=\"startRecording\" v-if=\"!recording\">\n <i class=\"fa fa-play\"></i>&nbsp; Start streaming audio\n </button>\n\n <button type=\"button\" @click=\"stopRecording\" v-else>\n <i class=\"fa fa-stop\"></i>&nbsp; Stop streaming audio\n </button>\n </div>\n </div>\n</template>\n\n<script>\nimport Utils from \"@/Utils\";\n\nexport default {\n name: \"Sound\",\n mixins: [Utils],\n\n data() {\n return {\n recording: false,\n };\n },\n\n methods: {\n startRecording() {\n this.recording = true\n },\n\n async stopRecording() {\n this.recording = false\n await this.request('sound.stop_recording')\n },\n },\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.sound {\n width: 100%;\n height: 90%;\n margin-top: 7%;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n align-items: center;\n\n .sound-container {\n margin-bottom: 1em;\n }\n}\n</style>\n","import { render } from \"./Index.vue?vue&type=template&id=30d09191&scoped=true\"\nimport script from \"./Index.vue?vue&type=script&lang=js\"\nexport * from \"./Index.vue?vue&type=script&lang=js\"\n\nimport \"./Index.vue?vue&type=style&index=0&id=30d09191&lang=scss&scoped=true\"\nscript.render = render\nscript.__scopeId = \"data-v-30d09191\"\n\nexport default script"],"sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -45,6 +45,9 @@
"rtorrent": {
"class": "fa fa-magnet"
},
"sound": {
"class": "fa fa-microphone"
},
"zigbee.mqtt": {
"imgUrl": "/icons/zigbee.svg"
},

View file

@ -23,6 +23,14 @@
</div>
<div class="right">
<button type="button" @click="startAudio" title="Start audio" v-if="!audioOn">
<i class="fas fa-volume-mute" />
</button>
<button type="button" @click="stopAudio" title="Stop audio" v-else>
<i class="fas fa-volume-up" />
</button>
<button type="button" @click="$refs.paramsModal.show()" title="Settings">
<i class="fas fa-cog" />
</button>
@ -30,6 +38,14 @@
</div>
</div>
<div class="audio-container">
<audio autoplay preload="none" ref="player" v-if="audioOn">
<!--suppress HtmlUnknownTarget -->
<source :src="`/sound/stream?t=${(new Date()).getTime()}`" type="audio/x-wav;codec=pcm">
Your browser does not support audio elements
</audio>
</div>
<div class="url" v-if="url?.length">
<label class="row">
<span class="name">Stream URL</span>

View file

@ -1,6 +1,10 @@
<script>
import Utils from "@/Utils";
export default {
name: "CameraMixin",
mixins: [Utils],
props: {
cameraPlugin: {
type: String,
@ -13,6 +17,7 @@ export default {
streaming: false,
capturing: false,
captured: false,
audioOn: false,
url: null,
attrs: {},
}
@ -87,6 +92,15 @@ export default {
onFpsChanged() {},
onGrayscaleChanged() {},
startAudio() {
this.audioOn = true
},
async stopAudio() {
this.audioOn = false
await this.request('sound.stop_recording')
},
},
created() {

View file

@ -46,11 +46,11 @@
</button>
<button type="button" @click="recording = true" v-if="!recording" :disabled="loading">
<i class="fa fa-volume-up" title="Start audio" />
<i class="fa fa-volume-mute" title="Start audio" />
</button>
<button type="button" @click="recording = false" v-else :disabled="loading">
<i class="fa fa-volume-mute" title="Stop audio" />
<i class="fa fa-volume-up" title="Stop audio" />
</button>
</div>
</div>

View file

@ -0,0 +1,63 @@
<template>
<div class="sound">
<div class="sound-container">
<audio autoplay preload="none" ref="player" v-if="recording">
<!--suppress HtmlUnknownTarget -->
<source :src="`/sound/stream?t=${(new Date()).getTime()}`" type="audio/x-wav;codec=pcm">
Your browser does not support audio elements
</audio>
</div>
<div class="controls">
<button type="button" @click="startRecording" v-if="!recording">
<i class="fa fa-play"></i>&nbsp; Start streaming audio
</button>
<button type="button" @click="stopRecording" v-else>
<i class="fa fa-stop"></i>&nbsp; Stop streaming audio
</button>
</div>
</div>
</template>
<script>
import Utils from "@/Utils";
export default {
name: "Sound",
mixins: [Utils],
data() {
return {
recording: false,
};
},
methods: {
startRecording() {
this.recording = true
},
async stopRecording() {
this.recording = false
await this.request('sound.stop_recording')
},
},
}
</script>
<style lang="scss" scoped>
.sound {
width: 100%;
height: 90%;
margin-top: 7%;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
.sound-container {
margin-bottom: 1em;
}
}
</style>

View file

@ -30,6 +30,10 @@ module.exports = {
'/camera/*': {
target: 'http://localhost:8008',
changeOrigin: true
},
'/sound/*': {
target: 'http://localhost:8008',
changeOrigin: true
}
}
}