Commit 9b2696f3 authored by ali's avatar ali

feat: sdk 导入

parent b1b26209
import type { HWLLSPlayer } from '@/renderer/utils/HWLLS_SDK_Web_2.3.0/export';
declare global {
// eslint-disable-next-line no-unused-vars
interface Window {
HWLLSPlayer: HWLLSPlayer
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -33,6 +33,7 @@
"dependencies": {
"axios": "^1.6.2",
"electron-store": "^8.1.0",
"EventEmitter": "^1.0.0",
"flv.js": "^1.6.2",
"pinia": "^2.1.7",
"pinia-plugin-persistedstate": "^3.2.0",
......@@ -73,4 +74,4 @@
"vue-tsc": "^1.8.22",
"xvfb-maybe": "^0.2.1"
}
}
}
\ No newline at end of file
......@@ -6,6 +6,6 @@
<body>
<div id="app"></div>
</body>
<!-- <script src="./utils/HWLLS_SDK_Web_2.3.0/lib/HWLLSPlayer.js"></script> -->
<script src="./utils/HWLLS_SDK_Web_2.3.0/lib/HWLLSPlayer.js"></script>
<script type="module" src="./main.ts"></script>
</html>
import EventEmitter from 'events';
// import { HWLLSSDK } from '@/renderer/utils/HWLLS_SDK_Web_2.3.0/export';
const { createClient, setLogLevel } = (window as any).HWLLSSDK.default;
import EventEmitter from 'EventEmitter';
/**
*
......@@ -68,7 +65,7 @@ export class HwWebRTC extends EventEmitter {
constructor(id: string, log: 'none' | 'error' | 'warn' | 'info' | 'debug' = 'none') {
super();
this.elementId = id;
setLogLevel(log);
// setLogLevel(log);
}
/**
......@@ -97,7 +94,7 @@ export class HwWebRTC extends EventEmitter {
*/
static async isBrowserSupport() {
let check = false;
check = await (window as any).HWLLSSDK.default.checkSystemRequirements();
check = await window.HWLLSPlayer.checkSystemRequirements();
return check;
}
......@@ -114,7 +111,7 @@ export class HwWebRTC extends EventEmitter {
) {
if (this.client) this.destroyed();
this.startPlayOptions = options;
this.client = createClient('webrtc');
this.client = window.HWLLSPlayer.createClient('webrtc');
await this.client.startPlay(url, {
elementId: this.elementId,
...this.startPlayOptions
......
......@@ -2,7 +2,7 @@
import http from '@/renderer/utils/http';
import { HwWebRTC } from './HwWebRTC';
import { guid } from '@/renderer/utils/index';
import EventEmitter from 'events';
import EventEmitter from 'EventEmitter';
const HOST = 'http://122.51.32.12:9000';
......
export * from './lib/HWLLSPlayer';
\ No newline at end of file
export * as HWLLSPlayer from './lib/HWLLSPlayer';
\ No newline at end of file
......@@ -21,11 +21,11 @@
},
"lib": ["esnext", "dom"]
},
"include": ["src/*.ts", "src/*.d.ts", "src/renderer"],
"include": ["src/*.ts", "src/*.d.ts", "src/renderer", "./env.d.ts"],
"references": [
{
"path": "./tsconfig.node.json"
}
],
"exclude": ["node_modules", "dist", "rollup.config.js", "*.json", "*.js"]
"exclude": ["node_modules", "dist", "rollup.config.js", "*.json", "*.js", "src/renderer/utils/HWLLS_SDK_Web_2.3.0/**'"]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment