Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

feat: rename attributes and docs #3

Merged
merged 2 commits into from
May 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,30 @@ It was primarily built for use in [Media Chrome](https://github.com/muxinc/media

### Methods

- `video.requestCast(options)`
- `CastableVideoElement.exitCast()`
- `video.requestCast(options)`: open the browser casting menu. Options:
- `receiverApplicationId`: defaults to Chromecast default receiver.
- `autoJoinPolicy` ('ORIGIN_SCOPED')
- `androidReceiverCompatible` (false): if `true` enables Cast Connect.
- `language` ('en-US')
- `resumeSavedSession` (false)
- `CastableVideoElement.exitCast()`: stop casting right away.

### Properties

- `CastableVideoElement.castElement`
- `CastableVideoElement.castAvailable`
- `CastableVideoElement.castElement`: the current video element being cast.
- `CastableVideoElement.castAvailable`: `true` when the Cast SDK is available.

### Events

- `entercast`
- `leavecast`
- `castchange`
- `castchange`: fires when cast status changes. e.g. cast device detected.
- `entercast`: fires when starting casting.
- `leavecast`: fires when stopping casting.

e.g. `video.addEventListener('entercast', () => {})`

### Attributes

- `stream-type`: add `<video "stream-type="live">` for live streams.
- `cast-src`: if Chromecast requires a different source than the one loaded.
- `cast-src`: if Chromecast requires a different source than the one loaded.
For example this would be needed if video src is a blob when using MSE.
- `cast-stream-type`: add `<video cast-stream-type="live">` for live streams.
- `cast-content-type`: required if Chromecast can't derive the content type from the source.