Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
cf2325e
:star: feat: implement new scrcpy for web
vangie Sep 10, 2025
47dd505
chore: remove unused package.json and pnpm-lock.yaml files; refactor …
vangie Sep 12, 2025
85c3932
feat: enhance logging and add verbose flag support in CLI
vangie Sep 14, 2025
6bf9004
feat: enhance device connection and streaming capabilities
vangie Sep 18, 2025
3714622
feat: enhance audio streaming and connection handling
vangie Sep 19, 2025
f866c9d
feat: enhance control service and event handling
vangie Sep 20, 2025
3f755ef
feat: enhance logging and error handling in device control events
vangie Sep 22, 2025
0d464d9
feat: enhance video handling and resize logic in AndroidLiveView and …
vangie Sep 22, 2025
9563b27
feat: refactor logging and error handling in device control and strea…
vangie Sep 23, 2025
5002b45
feat: update dependencies and improve logging in device control
vangie Sep 26, 2025
4ba9eea
feat: refactor API and device handling for improved routing and funct…
vangie Sep 27, 2025
711747c
feat: implement new streaming headers and refactor device audio handling
vangie Sep 27, 2025
c95e739
feat: remove deprecated H.264 and WebRTC control handlers, streamline…
vangie Sep 27, 2025
9aa4a77
feat: remove fMP4 stream writer and related tests to streamline trans…
vangie Sep 27, 2025
364a9e2
feat: add live view sdk
zhangze-github Oct 9, 2025
3ccf332
Merge branch 'vangie/implement-scrcpy-web' into zhangze/live-view
zhangze-github Oct 10, 2025
09081fb
feat: add publish npm
zhangze-github Oct 10, 2025
aff5d02
feat: add publish npm
zhangze-github Oct 10, 2025
1fd62dd
feat: add publish npm
zhangze-github Oct 10, 2025
f2507de
feat: add publish npm
zhangze-github Oct 10, 2025
fb2517f
feat: add publish npm
zhangze-github Oct 10, 2025
9f61121
feat: add publish npm
zhangze-github Oct 10, 2025
2df4136
feat: add publish npm
zhangze-github Oct 10, 2025
f105a84
feat: publish new npm version
zhangze-github Oct 10, 2025
6788a73
feat: add test live view entry
zhangze-github Oct 17, 2025
fb9e735
feat: add test live view entry
zhangze-github Oct 20, 2025
25d1d71
Rename package in README.md
hallee9000 Nov 22, 2025
c744ceb
Revise installation instructions in README.md
hallee9000 Nov 25, 2025
66ca05e
change scope name
hallee9000 Nov 25, 2025
1e57ea6
make it public
hallee9000 Nov 25, 2025
1e64fa7
change build file
hallee9000 Nov 25, 2025
85eb951
update version
hallee9000 Nov 25, 2025
35d4abe
fix errors
hallee9000 Nov 25, 2025
e50216e
update README and package.json
hallee9000 Nov 25, 2025
85cfdb3
resolve conflicts
hallee9000 Nov 27, 2025
ad0b47e
resolve conflicts again
hallee9000 Nov 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/publish-live-view.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish Live View Package

on:
push:
branches: [ zhangze/live-view ] # 监听当前分支
paths:
- 'packages/live-view/**' # 只监听live-view目录的变化

jobs:
publish:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
registry-url: 'https://npm.pkg.github.com'
scope: '@gbox'

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.17.0

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Install dependencies
working-directory: packages/live-view
run: pnpm install --frozen-lockfile

- name: Build SDK
working-directory: packages/live-view
run: npm run build:sdk

- name: Publish to GitHub Packages
working-directory: packages/live-view
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion packages/cli/cmd/device_connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,4 +622,4 @@ func registerDevice(deviceID string, deviceType string) error {
fmt.Printf("\n💡 Device registered successfully. Use 'gbox device-connect unregister %s' to disconnect when needed.\n", deviceID)

return nil
}
}
2 changes: 1 addition & 1 deletion packages/cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/sirupsen/logrus v1.9.3
github.com/spf13/pflag v1.0.6 // indirect
)
)
38 changes: 28 additions & 10 deletions packages/live-view/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @gbox/live-view
# @gbox.ai/live-view

Live view component for Android device streaming using WebRTC.

Expand All @@ -14,26 +14,30 @@ Live view component for Android device streaming using WebRTC.
## Installation

```bash
npm install @gbox/live-view
npm install @gbox.ai/live-view
# or
pnpm add @gbox/live-view
pnpm add @gbox.ai/live-view
```

## Usage

### As a React Component

```tsx
import { AndroidLiveView } from '@gbox/live-view';
// Import styles
import '@gbox.ai/live-view/style.css';

// import component
import AndroidLiveView from '@gbox.ai/live-view';

function App() {
return (
<AndroidLiveView
apiUrl="/api"
wsUrl="ws://localhost:8080/ws"
showControls={true}
showDeviceList={true}
showAndroidControls={true}
connectParams={{
deviceSerial: "68afd15",
apiUrl: "http://localhost:29888/api",
wsUrl: "ws://localhost:29888",
}}
onConnect={(device) => console.log('Connected to', device)}
onDisconnect={() => console.log('Disconnected')}
onError={(error) => console.error('Error:', error)}
Expand All @@ -42,6 +46,20 @@ function App() {
}
```

#### Next.js Usage Example

In Next.js projects, you can import styles in `app/layout.tsx` or `pages/_app.tsx`:

**App Router (app/layout.tsx):**
```tsx
import '@gbox.ai/live-view/style.css';
```

**Pages Router (pages/_app.tsx):**
```tsx
import '@gbox.ai/live-view/style.css';
```

### Props

- `apiUrl`: API endpoint URL (default: `/api`)
Expand Down Expand Up @@ -89,4 +107,4 @@ npm publish

## License

Apache-2.0
Apache-2.0
5 changes: 3 additions & 2 deletions packages/live-view/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
</style>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<!-- <script type="module" src="/sdk/use-sdk-entry.tsx"></script> -->
</body>
</html>
40 changes: 30 additions & 10 deletions packages/live-view/package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,45 @@
{
"name": "@gbox/live-view",
"version": "0.1.0",
"name": "@gbox.ai/live-view",
"version": "0.7.2",
"type": "module",
"description": "Live view component for Android device streaming",
"main": "dist/index.js",
"module": "dist/index.esm.js",
"main": "dist/index.umd.js",
"module": "dist/index.es.js",
"types": "dist/index.d.ts",
"sideEffects": [
"./dist/style.css",
"./dist/index.es.js",
"./dist/index.umd.js"
],
"exports": {
".": {
"import": "./dist/index.es.js",
"require": "./dist/index.umd.js",
"types": "./dist/index.d.ts"
},
"./style.css": {
"import": "./dist/style.css",
"require": "./dist/style.css",
"default": "./dist/style.css"
}
},
"files": [
"dist",
"static"
"README.md"
],
"scripts": {
"dev": "vite",
"build": "npm run build:component && npm run build:static",
"build": "vite build --config vite.config.sdk.ts",
"build:component": "rollup -c",
"build:static": "vite build",
"build:static": "vite build --config vite.config.sdk.ts",
"build:sdk": "vite build --config vite.config.sdk.ts",
"preview": "vite preview",
"type-check": "tsc --noEmit",
"lint": "eslint src",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
"build-sdk": "vite build --config vite.config.sdk.ts",
"prepublishOnly": "npm run build"
},
"peerDependencies": {
Expand Down Expand Up @@ -53,14 +72,15 @@
"rollup-plugin-postcss": "^4.0.2",
"ts-jest": "^29.1.1",
"typescript": "^5.3.3",
"vite": "^5.0.8"
"vite": "^5.0.8",
"vite-plugin-dts": "^4.5.4"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com"
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/gbox-ai/gbox.git",
"url": "https://github.com/babelcloud/gbox.git",
"directory": "packages/live-view"
},
"keywords": [
Expand Down
Loading
Loading