xiaopai-player-control

Control XiaoPai media player over LAN via HTTP/TCP. Use when asked to play videos, send remote-control keys, adjust volume, or query playback status on a XiaoPai player.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "xiaopai-player-control" with this command: npx skills add kuangxinyi/xiaopai-player-control

XiaoPai Player Control

Control a XiaoPai (小湃) media player on the local network through its TCP/IP protocol.

Prerequisites

  • The player and this machine must be on the same LAN.
  • The player's PlayerSupportApp service must be running (auto-starts on boot).
  • You need the player's IP address. Use auto-discovery (below) or ask the user.

Discover Player

The player registers an mDNS service (_xiaopai._tcp) on the LAN. Use any of these methods to find it without knowing the IP:

Linux/macOS:

# Browse for players (Bonjour)
dns-sd -B _xiaopai._tcp .

# Or with Avahi
avahi-browse -r _xiaopai._tcp

# Resolve a found service to get IP and port
dns-sd -L "<serviceName>" _xiaopai._tcp .

Windows:

# Requires Bonjour SDK or iTunes installed
dns-sd -B _xiaopai._tcp .

Python (cross-platform):

python3 -c "
from zeroconf import ServiceBrowser, Zeroconf, ServiceStateChange
import time

def on_change(zc, type_, name, state_change):
    if state_change is ServiceStateChange.Added:
        info = zc.get_service_info(type_, name)
        if info:
            from ipaddress import ip_address
            ip = ip_address(info.addresses[0])
            print(f'{info.server} -> {ip}:{info.port}  tcp_port={info.properties.get(b\"tcp_port\",b\"\").decode()}')

zc = Zeroconf()
ServiceBrowser(zc, '_xiaopai._tcp.local.', handlers=[on_change])
time.sleep(3)
zc.close()
"

Using the helper script:

xiaopai-ctl.sh discover

The discovered service includes:

  • port (9050): HTTP control port
  • TXT tcp_port (9051): TCP status port
  • TXT mac: Device MAC address

Available Operations

1. Send Remote-Control Key

Send any remote-control button press to the player.

curl "http://{IP}:9050/xiaopai/sendkey?keycode={KEYCODE}"

Response:

  • Success: {"code":0,"msg":"success"}
  • Unknown key: {"code":1,"msg":"unknown keycode"}

Supported keycodes (3-character uppercase):

CategoryKeycodesDescription
PowerPOW OFFPower toggle / Power off
NumbersNU0-NU9Number keys 0-9
NavigationNUP NDN NLT NRT SELUp / Down / Left / Right / OK
MenuOSD RET HOM SET MNU TOPMenu / Back / Home / Settings / PopMenu / TopMenu
VolumeVUP VDN MUTVolume Up / Volume Down / Mute
PlaybackPLA PAU PLU STPPlay-Pause toggle / Pause / Play / Stop
SeekFWD REVFast Forward / Rewind
TrackPRE NXTPrevious / Next
InfoINF DEL DOTInfo / Delete / Dot
AudioAUD SUB RPTAudio Track / Subtitle / Repeat
ColorRED GRE YEL BLURed / Green / Yellow / Blue
NavigateMOV MUS FILMovie page / Music page / File page
DACDAC DON DOFDAC switch / DAC on / DAC off
SystemRBT RES SCRReboot / Resolution / Screenshot

2. Play Video by File Path or URL

curl "http://{IP}:9050/xiaopai/play?videopath={URL_ENCODED_PATH}"
  • videopath: file path or URL of the video, must be URL-encoded.
  • Success: {"code":0,"msg":"success"}

Example:

curl "http://192.168.1.100:9050/xiaopai/play?videopath=http%3A%2F%2Fexample.com%2Fmovie.mp4"

3. Play Video by Name (Search Library)

curl "http://{IP}:9050/xiaopai/play?videoname={URL_ENCODED_NAME}"
  • videoname: movie/video name (Chinese or English), must be URL-encoded.
  • The player searches its local library; if a match is found, playback starts immediately.
  • Success: {"code":0,"msg":"success"}

Example:

# Play "战狼" (Wolf Warriors)
curl "http://192.168.1.100:9050/xiaopai/play?videoname=%E6%88%98%E7%8B%BC"

4. Query Player Status (TCP)

Connect to TCP port 9051 to receive real-time player state.

# One-shot status query (timeout after 2 seconds)
echo "" | nc -w 2 {IP} 9051

Response JSON:

{
  "code": 0,
  "msg": "success",
  "deviceName": "XiaoPai Player",
  "mac": "AA:BB:CC:DD:EE:FF",
  "ipAddress": "192.168.1.100",
  "playStatus": 1,
  "playType": 1
}

Field reference:

FieldValues
playStatus-1 = Stopped, 1 = Playing, 2 = Paused
playType1 = Video, 2 = Music

The TCP connection stays open; the player pushes updated JSON whenever playback state changes.

Common Workflows

Play a movie by name

curl "http://{IP}:9050/xiaopai/play?videoname={URL_ENCODED_NAME}"

Pause / Resume playback

curl "http://{IP}:9050/xiaopai/sendkey?keycode=PLA"

Adjust volume up

curl "http://{IP}:9050/xiaopai/sendkey?keycode=VUP"

Navigate home screen

curl "http://{IP}:9050/xiaopai/sendkey?keycode=HOM"

Check if something is playing, then stop it

STATUS=$(echo "" | nc -w 2 {IP} 9051)
# Parse playStatus from JSON; if playing, send stop
curl "http://{IP}:9050/xiaopai/sendkey?keycode=STP"

Guidelines

  • Always URL-encode Chinese characters and special characters in videopath and videoname parameters.
  • Use PLA to toggle play/pause. Use PLU for explicit play, PAU for explicit pause.
  • RBT will reboot the device — confirm with the user before sending.
  • The player responds to HTTP within milliseconds; no polling or retry is needed.
  • If the user doesn't know the player IP, use mDNS discovery (dns-sd -B _xiaopai._tcp . or the discover command) to find it automatically.
  • For rapid key sequences (e.g., navigating menus), add a short delay (~500ms) between commands.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Ai Competitor Analyzer

提供AI驱动的竞争对手分析,支持批量自动处理,提升企业和专业团队分析效率与专业度。

Registry SourceRecently Updated
General

Ai Data Visualization

提供自动化AI分析与多格式批量处理,显著提升数据可视化效率,节省成本,适用企业和个人用户。

Registry SourceRecently Updated
General

Ai Cost Optimizer

提供基于预算和任务需求的AI模型成本优化方案,计算节省并指导OpenClaw配置与模型切换策略。

Registry SourceRecently Updated