mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 23:51:20 -08:00
refactor(chromecast): [PKG-CAST-04] preserve published types and add runtime entry
This commit is contained in:
1 parent
b0cfbfe3a0
commit
8ec9fbe83a
27 files changed
+994
-52
No files matched your search
@@ -1,10 +1,11 @@
|
||||
import type Artplayer from 'artplayer'
|
||||
import type { RuntimeResult } from '../types/artplayer-plugin-chromecast'
|
||||
import type { AvailabilityEvent, CastContext, CastSdk, CastSession, ChromecastOptions, ConnectionState, SessionEvent } from './types'
|
||||
import icon from './cast.svg?raw'
|
||||
import { loadMedia } from './media'
|
||||
import { configure, loadSdk } from './sdk'
|
||||
|
||||
export function createController(art: Artplayer, option: ChromecastOptions) {
|
||||
export function createController(art: Artplayer, option: ChromecastOptions): RuntimeResult {
|
||||
let disposed = false
|
||||
let sdk: CastSdk | undefined
|
||||
let context: CastContext | undefined
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'disconnecting'
|
||||
|
||||
export interface ChromecastOptions {
|
||||
url?: string
|
||||
sdk?: string
|
||||
icon?: string
|
||||
mimeType?: string
|
||||
onStateChange?: (this: ChromecastOptions, state: ConnectionState) => void
|
||||
onCastAvailable?: (this: ChromecastOptions, available: boolean) => void
|
||||
onCastStart?: (this: ChromecastOptions) => void
|
||||
onError?: (this: ChromecastOptions, error: unknown) => void
|
||||
}
|
||||
export type { ConnectionState } from '../types/artplayer-plugin-chromecast'
|
||||
export type ChromecastOptions = import('../types/artplayer-plugin-chromecast').RuntimeOption
|
||||
|
||||
export interface MediaInfo {
|
||||
contentId: string
|
||||
|
||||
Reference in new issue
Block a user