# DLNA Casting Provider

Connects DLNA casting through a casting SPI or a local loopback test receiver.

- Repository: https://github.com/CarGuo/GSYVideoPlayer (21524 stars)
- Category: Mobile
- License: Apache-2.0
- Last updated: 2026-10-10
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add CarGuo/GSYVideoPlayer --skill gsy-cast-and-loopback -g -a claude-code -y`
Codex: `npx skills add CarGuo/GSYVideoPlayer --skill gsy-cast-and-loopback -g -a codex -y`
Cursor: `npx skills add CarGuo/GSYVideoPlayer --skill gsy-cast-and-loopback -g -a cursor -y`
Gemini CLI: `npx skills add CarGuo/GSYVideoPlayer --skill gsy-cast-and-loopback -g -a gemini-cli -y`

## Description

使用内核层投屏 SPI（CastCapability + CastProvider）接入 DLNA，或做本地 loopback 回环模拟被投屏端。

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# gsy-cast-and-loopback

## 顶层架构

```
CastCapability (单例)  ← 主线程 API 入口
  ├─ registerProvider(CastProvider)
  ├─ startDiscovery(Context) / stopDiscovery()
  ├─ getAvailableDevices(): List<CastDevice>
  ├─ connect(device, ConnectCallback) : CastSession（异步）
  ├─ addListener(CastListener)
  └─ disconnect()
```

对齐 Media3 `Player` 语义：`CastCapability ≈ Player 池`、`activeSession ≈ 当前 Player`、`CastProvider ≈ 渲染后端`、`CastListener/SessionListener ≈ Player.Listener`。见 [CastCapability](../../gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/cast/CastCapability.java) 与 [CastProvider](../../gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/cast/CastProvider.java) 的头 JavaDoc。

## 核心 API

### CastCapability

The rest: https://github.com/CarGuo/GSYVideoPlayer/blob/HEAD/skills/10-gsy-cast-and-loopback/SKILL.md
