Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/release-please/.release-please-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"packages/core": "10.0.1",
"packages/adapters/dash-video": "10.0.1",
"packages/element": "10.0.1",
"packages/extensions/fcast": "10.0.1",
"packages/extensions/google-cast": "10.0.1",
"packages/adapters/hlsjs-video": "10.0.1",
"packages/html": "10.0.1",
Expand Down
4 changes: 4 additions & 0 deletions .github/release-please/release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@videojs/core",
"@videojs/dash-video",
"@videojs/element",
"@videojs/fcast",
"@videojs/google-cast",
"@videojs/hlsjs-video",
"@videojs/html",
Expand Down Expand Up @@ -63,6 +64,9 @@
"packages/element": {
"component": "@videojs/element"
},
"packages/extensions/fcast": {
"component": "@videojs/fcast"
},
"packages/extensions/google-cast": {
"component": "@videojs/google-cast"
},
Expand Down
1 change: 1 addition & 0 deletions apps/sandbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@videojs/cloudflare-video": "workspace:*",
"@videojs/core": "workspace:*",
"@videojs/dash-video": "workspace:*",
"@videojs/fcast": "workspace:*",
"@videojs/google-cast": "workspace:*",
"@videojs/hlsjs-video": "workspace:*",
"@videojs/html": "workspace:*",
Expand Down
1 change: 1 addition & 0 deletions apps/sandbox/scripts/sync-source-owned-skins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ async function writeFixture(root: string, address: string, alias: string, baseSt
// Every package the registry items depend on, so the CLI copies files without installing anything.
dependencies: {
'@videojs/core': '*',
'@videojs/fcast': '*',
'@videojs/html': '*',
'@videojs/react': '*',
cn: '*',
Expand Down
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default {
'youtube-video',
'native-hls-video',
'dash-video',
'fcast',
'google-cast',
'hlsjs-video',
'mux-audio',
Expand Down
1 change: 1 addition & 0 deletions packages/cdn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"@videojs/cloudflare-video": "workspace:*",
"@videojs/core": "workspace:*",
"@videojs/dash-video": "workspace:*",
"@videojs/fcast": "workspace:*",
"@videojs/google-cast": "workspace:*",
"@videojs/hlsjs-video": "workspace:*",
"@videojs/html": "workspace:*",
Expand Down
10 changes: 10 additions & 0 deletions packages/core/src/core/ui/fcast-button/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineComponent } from 'vjsc/components';

/** Skin authoring contract; the runtime sender is supplied by @videojs/fcast. */
export default defineComponent<{
sender?: unknown;
src?: string | undefined;
contentType?: string | undefined;
}>({
name: 'FCastButton',
});
63 changes: 63 additions & 0 deletions packages/extensions/fcast/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# @videojs/fcast

An FCast casting option for Video.js 10. The package connects player playback controls to an FCast sender supplied by
your application. The sender handles receiver discovery, the device picker, the FCast connection, and receiver state.
Browsers cannot use the FCast SDK's TCP and mDNS features directly. Use a native SDK sender or a local bridge behind the
`FCastBridge` interface (`FCastSender` remains a compatible alias). This package defines the bridge contract; it does not implement a bridge.

```bash
pnpm add @videojs/react @videojs/fcast
# or
pnpm add @videojs/html @videojs/fcast
```

React:

```tsx
import { FCastButton } from '@videojs/react/ui/fcast-button';
import { CastButton } from '@videojs/react/ui/cast-button';
import { AirPlayButton } from '@videojs/react/ui/airplay-button';
import type { FCastSender } from '@videojs/fcast';

function CastingControls({ sender }: { sender: FCastSender }) {
return <>
<CastButton />
<AirPlayButton />
<FCastButton sender={sender}>FCast</FCastButton>
</>;
}
```

HTML:

```ts
import '@videojs/html/ui/cast-button';
import '@videojs/html/ui/airplay-button';
import '@videojs/html/ui/fcast-button';
import type { FCastSender } from '@videojs/fcast';

declare const sender: FCastSender; // Your application-provided native sender or bridge.
const button = document.querySelector('media-fcast-button');
button!.sender = sender;
```

```html
<media-cast-button></media-cast-button>
<media-airplay-button></media-airplay-button>
<media-fcast-button>FCast</media-fcast-button>
```

Place the controls inside a Video.js player. The button registers its own extension, so it can be included beside the
other controls. The FCast sender's `snapshot` reports availability, connection, playback position, duration, volume,
mute state, and speed. It dispatches a `change` event whenever those values change. `prompt()` opens the application
device picker; `disconnect()` ends the session; `load()` and the remaining commands control the receiver. The button
uses `src`/`contentType` when the receiver needs a different playable URL or MIME type from the local media.

The packaged video and live video skins include an FCast button, hidden until a sender is supplied. In React, pass
`fcastSender={sender}` to the skin. In HTML, assign `skin.fcastSender = sender` on the `<video-skin>` (or live video skin)
element. The skin also accepts `fcastSrc` and `fcastContentType` when the receiver needs a different source.

See the [FCast SDK](https://docs.fcast.org/sdk/) for native sender libraries and the
[FCast protocol](https://docs.fcast.org/protocol/v4/) for a bridge implementation.

The [FCast extension reference](https://videojs.org/docs/framework/react/reference/components/fcast) documents bridge lifecycle, command ordering, state normalization, and error events.
51 changes: 51 additions & 0 deletions packages/extensions/fcast/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "@videojs/fcast",
"version": "10.0.1",
"description": "FCast sender integration for Video.js",
"keywords": [
"cast",
"fcast",
"media",
"videojs"
],
"homepage": "https://videojs.org",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/videojs/v10",
"directory": "packages/extensions/fcast"
},
"files": [
"dist"
],
"type": "module",
"sideEffects": false,
"main": "dist/default/index.js",
"module": "dist/default/index.js",
"types": "dist/dev/index.d.ts",
"exports": {
".": {
"types": "./dist/dev/index.d.ts",
"development": "./dist/dev/index.js",
"default": "./dist/default/index.js"
}
},
"publishConfig": {
"access": "public"
},
"scripts": {
"build:watch": "vp pack --watch ./src --no-clean",
"dev": "pnpm run build:watch",
"test": "vp test run",
"clean": "rimraf --glob dist types '*.tsbuildinfo'"
},
"dependencies": {
"@videojs/core": "workspace:*",
"@videojs/media": "workspace:*",
"@videojs/utils": "workspace:*"
},
"devDependencies": {
"jsdom": "^26.1.0",
"vite-plus": "catalog:"
}
}
Loading