Files
plugin-record/ui/dist/plugin-record.umd.min.js

2 lines
5.2 KiB
JavaScript

(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["plugin-record"]=e():t["plugin-record"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s="fb15")}({5941:function(t,e,r){},f6fd:function(t,e){(function(t){var e="currentScript",r=t.getElementsByTagName("script");e in t||Object.defineProperty(t,e,{get:function(){try{throw new Error}catch(n){var t,e=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(n.stack)||[!1])[1];for(t in r)if(r[t].src==e||"interactive"==r[t].readyState)return r[t];return null}}})})(document)},f87e:function(t,e,r){"use strict";var n=r("5941"),o=r.n(n);o.a},fb15:function(t,e,r){"use strict";var n;(r.r(e),"undefined"!==typeof window)&&(r("f6fd"),(n=window.document.currentScript)&&(n=n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(r.p=n[1]));var o=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[1==t.$parent.titleTabActive?r("Records",{ref:"recordsPanel"}):r("stream-table",{scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[t.isRecording(n)?r("m-button",{attrs:{blink:""},on:{click:function(e){return t.stopRecord(n)}}},[t._v("正在录制")]):r("m-button",{on:{click:function(e){return t.record(n)}}},[t._v("录制")])]}}])})],1)},s=[],i=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("mu-data-table",{attrs:{data:t.data,columns:t.columns},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[r("td",[t._v(t._s(n.Path))]),r("td",[t._v(t._s(t.unitFormat(n.Size)))]),r("td",[t._v(t._s(t.toDurationStr(n.Duration)))]),r("td",[r("mu-button",{attrs:{icon:"",small:""},on:{click:function(e){return t.play(n)}}},[r("mu-icon",{attrs:{value:"play_arrow"}})],1),r("mu-button",{attrs:{icon:"",small:""},on:{click:function(e){return t.deleteFlv(n)}}},[r("mu-icon",{attrs:{value:"delete_forever"}})],1)],1)]}}])})},a=[],c={data(){return{data:[],columns:[{title:"文件路径"},{title:"大小"},{title:"时长"},{title:"操作"}]}},methods:{play(t){this.ajax.get("/record/flv/play",{streamPath:t.Path.replace(".flv","")},t=>{"success"==t?(this.ajax.getJSON("/record/flv/list",t=>this.data=t),this.$toast.success("开始发布")):this.$toast.error(t)})},deleteFlv(t){this.$confirm("是否删除Flv文件","提示").then(e=>{if(e)return this.ajax.get("/record/flv/delete",{streamPath:t.Path.replace(".flv","")},t=>{"success"==t?this.$toast.success("删除成功"):this.$toast.error(t)})})},toDurationStr(t){if(t>1e3){let e=t/1e3;if(e>60){e|=0;let t=e/60>>0;if(t>60){let e=t/60>>0;return e+"hour"+t%60+"min"}return t+"min"+e%60+"s"}return e.toFixed(3)+"s"}return t+"ms"}},mounted(){this.ajax.getJSON("/record/flv/list",t=>this.data=t)}},u=c;function l(t,e,r,n,o,s,i,a){var c,u="function"===typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=r,u._compiled=!0),n&&(u.functional=!0),s&&(u._scopeId="data-v-"+s),i?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},u._ssrRegister=c):o&&(c=a?function(){o.call(this,this.$root.$options.shadowRoot)}:o),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(t,e){return c.call(e),l(t,e)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,c):[c]}return{exports:t,options:u}}var f=l(u,i,a,!1,null,null,null),d=f.exports,p={components:{Records:d},data(){return{}},methods:{record(t){let e=!1;this.$confirm(t=>t("mu-switch",{props:{label:"追加模式"},on:{change(t){e=t}}}),"是否开始录制").then(r=>{r&&this.ajax.get("/record/flv?append="+e,{streamPath:t.StreamPath},t=>{"success"==t?this.$toast.success("开始录制"+(e?"(追加模式)":"")):this.$toast.error(t)})})},stopRecord(t){this.$confirm("是否停止录制","提示").then(e=>{e&&this.ajax.get("/record/flv/stop",{streamPath:t.StreamPath},t=>{"success"==t?this.$toast.success("停止录制"):this.$toast.error(t)})})},isRecording(t){return t.SubscriberInfo&&t.SubscriberInfo.find(t=>"FlvRecord"==t.Type)}},mounted(){this.$parent.titleTabs=["StreamList","录制的视频"]}},h=p,m=(r("f87e"),l(h,o,s,!1,null,"015b8bdf",null)),v=m.exports;e["default"]=v}})["default"]}));
//# sourceMappingURL=plugin-record.umd.min.js.map