UNPKG

@blackprint/nodes-multimedia

Version:
2 lines 2.7 kB
!async function(e,t){"use strict";async function s(e){return"undefined"!=typeof sf&&void 0!==sf.loader?await sf.loader.mjs(e):Promise.all(e.map((e=>import(e))))}t.exports&&t.exports!==globalThis&&Object.defineProperty(t.exports,"__esModule",{value:!0}),s.task=function(){return"undefined"!=typeof sf&&void 0!==sf.loader?sf.loader.task:null},e.templates||(e.templates={});var i=sf.dom||sf.$,a=e.templates;e._sf_internal=e._sf_internal||{body_map:{},_replace(e,t){let s=i(t);return this.body_map[e]&&this.body_map[e].remove(),this.reinitViews&&this.reinitViews(s),this.body_map[e]=s},append(e,t){i(document.body).append(this._replace.apply(this,arguments))},prepend(e,t){i(document.body).prepend(this._replace.apply(this,arguments))}};await s.task();let l=e.Blackprint.loadScope({url:import.meta.url}),o=(sf.$,await l.getContext("Multimedia")),{fakeDestination:p,objLength:n}=o;a["BPIC/Multimedia/Display/Video.sf"]='<div class="node" style="transform: translate({{x}}px, {{y}}px)"><sf-template path="Blackprint/nodes/template/routes.sf"></sf-template><sf-template path="Blackprint/nodes/template/header.sf"></sf-template><div class="content"><video crossorigin="anonymous"></video><div class="left-port"><sf-template path="Blackprint/nodes/template/input-port.sf"></sf-template></div><div class="right-port"><sf-template path="Blackprint/nodes/template/output-port.sf"></sf-template></div></div><sf-template path="Blackprint/nodes/template/other.sf"></sf-template></div>',l.Sketch.registerInterface("BPIC/Multimedia/Display/Video",class extends o.IFace.Video{init(e){this.videoElement=this.$el("video"),super.init(e)}initClone(e){this.videoElement=this.$el("video")}hotReloadedHTML(){this.initClone()}}),a["BPIC/Multimedia/Audio/Input/Microphone.sf"]='<div class="node input" style="transform: translate({{x}}px, {{y}}px)"><sf-template path="Blackprint/nodes/template/routes.sf"></sf-template><sf-template path="Blackprint/nodes/template/header.sf"></sf-template><div class="content"><select sf-bind="selected"><option value="{{val.i}}" sf-each="val in devices">{{val.label}}</option></select><div class="right-port"><sf-template path="Blackprint/nodes/template/output-port.sf"></sf-template></div></div><sf-template path="Blackprint/nodes/template/other.sf"></sf-template></div>',l.Sketch.registerInterface("BPIC/Multimedia/Audio/Input/Microphone",class extends o.IFace.Microphone{constructor(e){super(e)}init(){super.init()}initClone(){this.init()}v2m$selected(e){this.select(e)}hotReloaded(){this.init()}hotReload(){}})}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this,"undefined"!=typeof module?module:{exports:this}); //# sourceMappingURL=nodes-multimedia.sf.mjs.map