minicap-driver
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

minicap-driver

一个对 minicap 的 node.js 封装,不需要关注 minicap 的底层原理,让你轻松实现电脑浏览器实时投影 android 设备,并保证高帧率。

server side

 
import * as minicapDriver from 'minicap-driver'
import { Server as WebSocketServer } from 'ws'
 
const wss = new WebSocketServer({ port: 9002 })
 
;(async () => {
    await minicapDriver.init()
    wss.on('connection', async ws => {
        console.log('conncetion')
        await minicapDriver.start(ws)
    })
})()

client side just like this:

import { minicapClient } from 'minicap-driver/dist/client'
 
minicapClient('ws://localhost:9002', '#canvas')

就是这么简单,例子可以看example

Readme

Keywords

none

Package Sidebar

Install

npm i minicap-driver

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

23.7 kB

Total Files

14

Last publish

Collaborators

  • huruji