摘要:是下一代面向物联网和边缘计算的智能操作系统,可广泛应用于面向个人家庭和行业的物联网产品和解决方案,有效降低开发门槛缩短开发周期。
{ "name": "com.example.monitoring", "version": "0.0.1", "description": "家用智能监控", "main": "main.js", "scripts": { "build": "eos build" }, "license": "MIT", "dependencies": { "@edgeros/jsre-medias": "^2.0.0" }, "devDependencies": { "eslint": "^7.23.0", "@edgeros/jsre-types": "^0.1.1", "@edgeros/eslint-plugin-jsre": "^0.0.3" }, "author": "xxxxxx@qq.com"}
/* Import system modules */const WebApp = require("webapp");const WebMedia = require("webmedia");const bodyParser = require("middleware").bodyParser;const {Manager} = require("@edgeros/jsre-medias");const CameraSource = require("./camera_src");
/* Register media source. */const sourceName = "camera-flv";WebMedia.registerSource(sourceName, CameraSource);/* WebApp. */var app = WebApp.createApp();/* Set static path. */app.use(WebApp.static("/public"));/* Media manage server. */var server = undefined;/* Is server starting. */var starting = false;
/* * Create Media server. */function createMediaSer() { console.log("Create media server."); if (server) { return server; } var opts = { mediaTimeout: 1800000, searchCycle: 20000, autoGetCamera: false }; server = new Manager(app, null, opts, (opts) => { return { source: sourceName, inOpts: opts, outOpts: null } }); server.on("open", (media) => { console.log("Media open.") media.on("open", (media, client) => console.log("Media client open.")); media.on("close", (media, client) => console.log("Media client close.")); }); return server;}
/* * res: [{devId, alias, report, status}...] */app.get("/api/list", (req, res) => { if (!server) { var ret = startServer(); if (!ret) { return res.json([]); } } var devs = []; server.iterDev((key, dev) => { var info = dev.dev; var stream = dev.mainStream; var media = stream ? stream.media : null; devs.push({ devId: key, alias: `${info.hostname}:${info.port}${info.path}`, report: info.urn, path: media ? "/" + media.sid : "", status: media ? true: false }); }); res.send(JSON.stringify(devs));});
import Vue from "vue";import App from "./App.vue";import router from "./router";import Vant from "vant";import "vant/lib/index.css";import {Notify} from "vant";import {edger} from "@edgeros/web-sdk";import {setToken, setSrand} from "./lib/auth";import {setPerms, checkPerms, requestPerm} from "./lib/permission";
console.log(typeof Module);console.log(typeof NodePlayer);Vue.config.productionTip = false;Vue.use(Vant);Vue.use(Notify);edger.onAction("permission", (data) => { setPerms(data);});edger.onAction("token", (result) => { const { token, srand } = result; setToken(token); setSrand(srand);});edger.token().then((result) => { const {token, srand} = result; setToken(token); setSrand(srand);}).then(() => { var ret = checkPerms(); if (ret.length > 0) { requestPerm(); }}).catch((err) => { console.error(err);}).finally(() => { NodePlayer.load(()=>{ new Vue({ router, render: h => h(App), }).$mount("#app"); });});
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/123275.html
摘要:一个物联网操作系统是否能够流行,其与其他设备的友好连接性会是一个非常重要的衡量指标。内置了众多安全存储与安全通讯技术,能够鉴别可信硬件,识别并拒绝未经授权的设备或用户访问系统应用和数据,把安全措施不足的普通物联网设备置于强大的保护之下。 ...
摘要:有鉴于此,本文以未安装工具软件的计算机未激活的爱智设备为例,实战解说零基础小白的爱智开发过程。爱智设备断开互联网也可以运行,但本文中的开发部署等功能无法操作。 【本...
摘要:证书安装步骤我也是跟着官方给的教程一步一步来,可以参考安装成功如下所示三应用开发到这里软硬件方面的部署已经基本完成,现在让我来带大家用爱智系统做一个小游戏。 本文正...
摘要:为广大开发者提供基于互联网技术栈的操作系统平台,极大简化了物联网开发难度,提高开发效率。边缘计算借助硬件的计算能力,为家庭和企业提供强大的边缘计算能力,不仅能够满足物联网时代家庭生活和企业计算的多种需求,还能够降低用户设备和网络的成本。 EdgerOs介绍 EdgerOS 是为万物互联时代而...
阅读 3405·2023-04-25 22:44
阅读 902·2021-11-15 11:37
阅读 1613·2019-08-30 15:55
阅读 2594·2019-08-30 15:54
阅读 1058·2019-08-30 13:45
阅读 1412·2019-08-29 17:14
阅读 1814·2019-08-29 13:50
阅读 3368·2019-08-26 11:39