@scarlett-player/chromecast 0.1.0 → 0.1.1
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.
- package/README.md +80 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# @scarlett-player/chromecast
|
|
2
|
+
|
|
3
|
+
Chromecast plugin for Scarlett Player. Enables casting to Chromecast and Google Cast-compatible devices.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @scarlett-player/core @scarlett-player/chromecast
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { ScarlettPlayer } from '@scarlett-player/core';
|
|
15
|
+
import { createHLSPlugin } from '@scarlett-player/hls';
|
|
16
|
+
import { chromecastPlugin } from '@scarlett-player/chromecast';
|
|
17
|
+
|
|
18
|
+
const player = new ScarlettPlayer({
|
|
19
|
+
container: document.getElementById('player'),
|
|
20
|
+
plugins: [
|
|
21
|
+
createHLSPlugin(),
|
|
22
|
+
chromecastPlugin({
|
|
23
|
+
receiverApplicationId: 'YOUR_APP_ID', // Optional, uses default media receiver
|
|
24
|
+
}),
|
|
25
|
+
],
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// Start casting
|
|
29
|
+
await player.requestChromecast();
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Configuration
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
chromecastPlugin({
|
|
36
|
+
// Custom receiver app ID (optional)
|
|
37
|
+
receiverApplicationId: 'YOUR_APP_ID',
|
|
38
|
+
|
|
39
|
+
// Auto-join existing session
|
|
40
|
+
autoJoinPolicy: 'ORIGIN_SCOPED',
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## API
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
const plugin = player.getPlugin('chromecast');
|
|
48
|
+
|
|
49
|
+
// Check availability
|
|
50
|
+
plugin.isAvailable(); // true if Cast SDK loaded
|
|
51
|
+
|
|
52
|
+
// Check if casting
|
|
53
|
+
plugin.isActive(); // true if casting
|
|
54
|
+
|
|
55
|
+
// Show device picker
|
|
56
|
+
await plugin.requestSession();
|
|
57
|
+
|
|
58
|
+
// Stop casting
|
|
59
|
+
plugin.stopCasting();
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Events
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
player.on('chromecast:available', () => {
|
|
66
|
+
// Cast SDK ready
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
player.on('chromecast:connected', ({ deviceName }) => {
|
|
70
|
+
// Connected to device
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
player.on('chromecast:disconnected', () => {
|
|
74
|
+
// Disconnected
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scarlett-player/chromecast",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Chromecast Plugin for Scarlett Player",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"bugs": {
|
|
53
53
|
"url": "https://github.com/Hackney-Enterprises-Inc/scarlett-player/issues"
|
|
54
54
|
},
|
|
55
|
-
"homepage": "https://
|
|
55
|
+
"homepage": "https://scarlettplayer.com"
|
|
56
56
|
}
|