@quicktvui/ai-cli 0.1.0 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@quicktvui/quicktvui-template",
3
+ "appName": "quicktvui-template",
4
+ "version": "0.0.1",
5
+ "main": "./src/main.ts",
6
+ "icon": "./src/assets/logo.png",
7
+ "private": true,
8
+ "scripts": {
9
+ "dev": "qt-dev android",
10
+ "build:android": "qt-build android",
11
+ "build:harmony": "qt-build harmony",
12
+ "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
13
+ "format": "prettier --write src/",
14
+ "prepare": "husky install"
15
+ },
16
+ "dependencies": {
17
+ "@quicktvui/quicktvui3": "^3.0.0",
18
+ "vue": "^3.4.21",
19
+ "vue-tsc": "^2.0.11"
20
+ },
21
+ "devDependencies": {
22
+ "@quicktvui/build-tools": "^1.0.0",
23
+ "@quicktvui/ai": "^1.0.0",
24
+ "husky": "^8.0.0"
25
+ },
26
+ "lint-staged": {
27
+ "*.{js,ts,vue}": "prettier --write"
28
+ }
29
+ }
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <div id="root">
3
+ <es-router-view />
4
+ </div>
5
+ </template>
6
+
7
+ <script lang="ts">
8
+ import { defineComponent } from '@vue/runtime-core'
9
+
10
+ export default defineComponent({
11
+ name: 'App',
12
+ setup() {
13
+ function onESCreate(app, params) {}
14
+
15
+ return {
16
+ onESCreate
17
+ }
18
+ }
19
+ })
20
+ </script>
21
+
22
+ <style scoped>
23
+ #root {
24
+ width: 1920px;
25
+ height: 1080px;
26
+ flex: 1;
27
+ display: flex;
28
+ flex-direction: column;
29
+ }
30
+ </style>
@@ -0,0 +1,48 @@
1
+ import { defineComponent, h, ref } from 'vue'
2
+ import { Native } from '@extscreen/es3-vue'
3
+
4
+ const WebRTCPlayer = defineComponent({
5
+ name: 'WebRTCPlayerComponent',
6
+ props: {
7
+ wsUrl: {
8
+ type: String,
9
+ default: ''
10
+ },
11
+ play: {
12
+ type: Boolean,
13
+ default: false
14
+ }
15
+ },
16
+ emits: [],
17
+ setup(props, context) {
18
+ const viewRef = ref()
19
+
20
+ function reload() {
21
+ Native.callUIFunction(viewRef.value, 'reload', [])
22
+ }
23
+
24
+ function release() {
25
+ Native.callUIFunction(viewRef.value, 'release', [])
26
+ }
27
+
28
+ context.expose({
29
+ reload,
30
+ release
31
+ })
32
+
33
+ return () => {
34
+ const children = context.slots.default && context.slots.default()
35
+ return h(
36
+ 'tv.huan.xiaoyou.webrtc.WebRTCPlayerComponent',
37
+ {
38
+ ref: viewRef,
39
+ wsUrl: props.wsUrl,
40
+ play: props.play
41
+ },
42
+ children
43
+ )
44
+ }
45
+ }
46
+ })
47
+
48
+ export default WebRTCPlayer
@@ -0,0 +1,29 @@
1
+ import { ESApp } from '@extscreen/es3-vue'
2
+ import application from './App.vue'
3
+
4
+ import { createESRouter, Router } from '@extscreen/es3-router'
5
+ import routes from './routes'
6
+
7
+ const routerOptions = {
8
+ main: 'home',
9
+ error: 'error',
10
+ limit: 10,
11
+ routes: routes
12
+ }
13
+ let router: Router = createESRouter(routerOptions)
14
+ import { createESApp } from '@extscreen/es3-core'
15
+
16
+ const app: ESApp = createESApp(application, router)
17
+
18
+ import { ESComponent } from '@extscreen/es3-component'
19
+
20
+ app.use(ESComponent)
21
+
22
+ import '@quicktvui/quicktvui3/dist/index.css'
23
+ import { QuickTVUI } from '@quicktvui/quicktvui3'
24
+
25
+ app.use(QuickTVUI)
26
+
27
+ // Register WebRTCPlayer
28
+ import WebRTCPlayer from './components/WebRTCPlayer'
29
+ app.component('WebRTCPlayer', WebRTCPlayer)
@@ -0,0 +1,21 @@
1
+ import home from './views/home.vue'
2
+ import error from './views/error.vue'
3
+ import cast from './views/cast.vue'
4
+
5
+ export default [
6
+ {
7
+ path: '/home',
8
+ name: 'home',
9
+ component: home
10
+ },
11
+ {
12
+ path: '/error',
13
+ name: 'error',
14
+ component: error
15
+ },
16
+ {
17
+ path: '/cast',
18
+ name: 'cast',
19
+ component: cast
20
+ }
21
+ ]
@@ -0,0 +1,42 @@
1
+ <template>
2
+ <div class="cast-page">
3
+ <WebRTCPlayer ref="playerRef" class="player" :wsUrl="wsUrl" :play="true" />
4
+ </div>
5
+ </template>
6
+
7
+ <script lang="ts">
8
+ import { defineComponent, ref } from 'vue'
9
+ import { useESRouter } from '@extscreen/es3-router'
10
+
11
+ export default defineComponent({
12
+ name: 'cast',
13
+ setup() {
14
+ const router = useESRouter()
15
+ const wsUrl = ref('')
16
+ const playerRef = ref(null)
17
+
18
+ // Parse params from router
19
+ const params = router.getParams()
20
+ if (params && params.ws_url) {
21
+ wsUrl.value = params.ws_url
22
+ }
23
+
24
+ return {
25
+ wsUrl,
26
+ playerRef
27
+ }
28
+ }
29
+ })
30
+ </script>
31
+
32
+ <style scoped>
33
+ .cast-page {
34
+ width: 1920px;
35
+ height: 1080px;
36
+ background-color: #000000;
37
+ }
38
+ .player {
39
+ width: 1920px;
40
+ height: 1080px;
41
+ }
42
+ </style>
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <div class="error-root-view-css">
3
+ <span class="error-text-css" ref="errorText">error页面</span>
4
+ </div>
5
+ </template>
6
+
7
+ <script lang="ts">
8
+ import { defineComponent } from '@vue/runtime-core'
9
+
10
+ export default defineComponent({
11
+ name: 'error',
12
+ setup() {
13
+ return {}
14
+ }
15
+ })
16
+ </script>
17
+
18
+ <style scoped>
19
+ .error-root-view-css {
20
+ width: 1920px;
21
+ height: 1080px;
22
+ background-color: darkgray;
23
+ display: flex;
24
+ flex-direction: column;
25
+ align-items: center;
26
+ justify-content: center;
27
+ }
28
+
29
+ .error-text-css {
30
+ font-size: 40px;
31
+ }
32
+ </style>
@@ -0,0 +1,60 @@
1
+ <template>
2
+ <div class="index-root-view-css">
3
+ <qt-image class="index-root-logo-css" :src="logo"></qt-image>
4
+ <qt-text class="index-root-text-view-css" gravity="center" text="等待投屏..." />
5
+ <qt-text class="ip-text" gravity="center" :text="`设备名称: ${deviceName}`" />
6
+ </div>
7
+ </template>
8
+
9
+ <script lang="ts">
10
+ import { defineComponent, ref } from 'vue'
11
+ import logo from '../assets/logo.png'
12
+
13
+ export default defineComponent({
14
+ name: 'home',
15
+ setup() {
16
+ const deviceName = ref('客厅电视')
17
+
18
+ return {
19
+ logo,
20
+ deviceName
21
+ }
22
+ }
23
+ })
24
+ </script>
25
+
26
+ <style>
27
+ .index-root-view-css {
28
+ width: 1920px;
29
+ height: 1080px;
30
+ background-color: #1e1e1e;
31
+ display: flex;
32
+ flex-direction: column;
33
+ align-items: center;
34
+ justify-content: center;
35
+ }
36
+
37
+ .index-root-text-view-css {
38
+ width: 1920px;
39
+ height: 100px;
40
+ font-size: 60px;
41
+ color: #ffffff;
42
+ text-align: center;
43
+ margin-top: 40px;
44
+ }
45
+
46
+ .ip-text {
47
+ width: 1920px;
48
+ height: 60px;
49
+ font-size: 30px;
50
+ color: #aaaaaa;
51
+ text-align: center;
52
+ margin-top: 20px;
53
+ }
54
+
55
+ .index-root-logo-css {
56
+ width: 200px;
57
+ height: 200px;
58
+ margin-bottom: 30px;
59
+ }
60
+ </style>
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "strict": true,
4
+ "target": "esnext",
5
+ "module": "esnext",
6
+ "lib": ["esnext", "dom"],
7
+ "declaration": true,
8
+ "rootDir": ".",
9
+ "baseUrl": "./",
10
+ "outDir": "dist",
11
+ "jsx": "preserve",
12
+ "moduleResolution": "node",
13
+ "allowJs": false,
14
+ "esModuleInterop": true,
15
+ "noImplicitAny": false
16
+ },
17
+ "include": ["src/*.ts", "src/*.vue", "src/**/*.ts", "src/**/*.vue", "test", "app.d.ts"],
18
+ "exclude": ["node_modules", "dist", "**/dist", "**/node_modules"]
19
+ }