1 Star 0 Fork 0

baolong/xremote-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

XRemote JS

build codecov

XRemote is a web implementation for the Xbox One/Series streaming protocol.

The package provides API to access and collect stream data of your Xbox console.

Usage

You can install @yowari/xremote package using npm:

npm install @yowari/xremote

After install finishes, you can use the provided API to connect to your Xbox console:

import { Buttons, Client, VIDEO_CHANNEL } from '@yowari/xremote';

const OAUTH_TOKEN = 'secret-token'; // retrieve your token from https://www.xbox.com/en-US/play

const client = new Client();
await client.login(OAUTH_TOKEN);
const consoles = await client.getConsoles();
const session = await client.createSession(consoles.results[0].serverId);
await client.startStream(session.sessionId);

// Get video stream
const videoChannel = client.getChannel(VIDEO_CHANNEL);
videoChannel.addEventListener('frame', (event) => {
  // render(event.frame)
});

// Control the gamepad
const gamepadManager = client.getGamepadManager();
gamepadManager.pressButton(0, Buttons.Nexus);
setTimeout(() => gamepadManager.releaseButton(0, Buttons.Nexus), 25);

Develop

For easy environment setup, use nvm with the command bellow

nvm use

This will set the appropriate node version defined in .nvmrc.

The project source code is written in TypeScript. To transpile the code and build the production bundle, run the following command:

npm run build

The project uses Jest for tests. Use the command bellow to run the tests:

npm run test

Credit

空文件

简介

clone 备份来的... 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/baohongyu/xremote-js.git
git@gitee.com:baohongyu/xremote-js.git
baohongyu
xremote-js
xremote-js
main

搜索帮助