Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 9b0e06cd authored by Simon Chan's avatar Simon Chan
Browse files

feat(scrcpy-server): separate package, add support for Vite

parent 419a7559
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@
        "tsbuildinfo",
        "typeof",
        "undici",
        "versioncode",
        "webadb",
        "webcodecs",
        "webm",
+0 −9
Original line number Diff line number Diff line
@@ -39,15 +39,6 @@ module.exports = pipe(
            basePath,
        },
        webpack(config) {
            // Bundle Scrcpy Server
            config.module.rules.push({
                resourceQuery: /url/,
                type: "asset/resource",
                generator: {
                    filename: "static/chunks/[name].[hash][ext]",
                },
            });

            config.module.rules.push({
                test: /.*\.m?js$/,
                // disable these modules because they generate a lot of warnings about
+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
        "@yume-chan/async": "^2.2.0",
        "@yume-chan/b-tree": "workspace:^0.0.20",
        "@yume-chan/event": "workspace:^0.0.20",
        "@yume-chan/fetch-scrcpy-server": "workspace:^0.0.20",
        "@yume-chan/pcm-player": "workspace:^0.0.20",
        "@yume-chan/scrcpy": "workspace:^0.0.20",
        "@yume-chan/scrcpy-decoder-tinyh264": "workspace:^0.0.20",
+2 −6
Original line number Diff line number Diff line
import { EventEmitter } from "@yume-chan/event";

const SERVER_URL = new URL(
    "@yume-chan/scrcpy/bin/scrcpy-server?url",
    import.meta.url
);
import { BIN } from "@yume-chan/fetch-scrcpy-server";

class FetchWithProgress {
    public readonly promise: Promise<Uint8Array>;
@@ -68,7 +64,7 @@ export function fetchServer(
    onProgress?: (e: [downloaded: number, total: number]) => void
) {
    if (!cachedValue) {
        cachedValue = new FetchWithProgress(SERVER_URL);
        cachedValue = new FetchWithProgress(BIN);
        cachedValue.promise.catch(() => {
            cachedValue = undefined;
        });
+4 −4
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ import {
    ScrcpyVideoDecoderConstructor,
    TinyH264Decoder,
} from "@yume-chan/scrcpy-decoder-tinyh264";
import SCRCPY_SERVER_VERSION from "@yume-chan/scrcpy/bin/version";
import { VERSION } from "@yume-chan/fetch-scrcpy-server";
import { DecodeUtf8Stream, GatherStringStream } from "@yume-chan/stream-extra";
import {
    autorun,
@@ -305,7 +305,7 @@ export const SETTING_DEFINITIONS = computed(() => {
                        const displays = await AdbScrcpyClient.getDisplays(
                            GLOBAL_STATE.adb!,
                            DEFAULT_SERVER_PATH,
                            SCRCPY_SERVER_VERSION,
                            VERSION,
                            new AdbScrcpyOptionsLatest(
                                new ScrcpyOptionsLatest({
                                    logLevel: ScrcpyLogLevel.Debug,
@@ -403,7 +403,7 @@ export const SETTING_DEFINITIONS = computed(() => {
                            const encoders = await AdbScrcpyClient.getEncoders(
                                GLOBAL_STATE.adb!,
                                DEFAULT_SERVER_PATH,
                                SCRCPY_SERVER_VERSION,
                                VERSION,
                                new AdbScrcpyOptionsLatest(
                                    new ScrcpyOptionsLatest({
                                        logLevel: ScrcpyLogLevel.Debug,
@@ -537,7 +537,7 @@ export const SETTING_DEFINITIONS = computed(() => {
                            const encoders = await AdbScrcpyClient.getEncoders(
                                GLOBAL_STATE.adb!,
                                DEFAULT_SERVER_PATH,
                                SCRCPY_SERVER_VERSION,
                                VERSION,
                                new AdbScrcpyOptionsLatest(
                                    new ScrcpyOptionsLatest({
                                        logLevel: ScrcpyLogLevel.Debug,
Loading