mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
feat(packages): add chromecast support via remote playback API (#1348)
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
'use client';
|
||||
|
||||
import { CastButtonCore, CastButtonDataAttrs } from '@videojs/core';
|
||||
import { selectCast } from '@videojs/core/dom';
|
||||
|
||||
import type { UIComponentProps } from '../../utils/types';
|
||||
import { createMediaButton } from '../create-media-button';
|
||||
|
||||
export interface CastButtonProps extends UIComponentProps<'button', CastButtonCore.State>, CastButtonCore.Props {}
|
||||
|
||||
/** A button that toggles casting to a remote device. */
|
||||
export const CastButton = createMediaButton<CastButtonCore, CastButtonProps>({
|
||||
displayName: 'CastButton',
|
||||
core: CastButtonCore,
|
||||
stateAttrMap: CastButtonDataAttrs,
|
||||
selector: selectCast,
|
||||
action: (core, state) => core.toggle(state),
|
||||
});
|
||||
|
||||
export namespace CastButton {
|
||||
export type Props = CastButtonProps;
|
||||
export type State = CastButtonCore.State;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from './cast-button';
|
||||
Reference in New Issue
Block a user