@symbiote-native/video 0.0.0-stage → 0.0.0
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/LICENSE +21 -0
- package/README.md +67 -2
- package/build/angular/index.d.ts +4 -0
- package/build/angular/index.js +5 -0
- package/build/angular/inject-video-player.d.ts +4 -0
- package/build/angular/inject-video-player.js +6 -0
- package/build/angular/video-airplay-button/index.d.ts +12 -0
- package/build/angular/video-airplay-button/index.js +78 -0
- package/build/angular/video-view/index.d.ts +17 -0
- package/build/angular/video-view/index.js +97 -0
- package/build/core/constants.d.ts +12 -0
- package/build/core/constants.js +13 -0
- package/build/core/index.d.ts +10 -0
- package/build/core/index.js +8 -0
- package/build/core/native-module.d.ts +10 -0
- package/build/core/native-module.js +3 -0
- package/build/core/player-types.d.ts +221 -0
- package/build/core/player-types.js +1 -0
- package/build/core/video-airplay-button.d.ts +4 -0
- package/build/core/video-airplay-button.js +29 -0
- package/build/core/video-module.d.ts +12 -0
- package/build/core/video-module.js +21 -0
- package/build/core/video-player-controller.d.ts +15 -0
- package/build/core/video-player-controller.js +21 -0
- package/build/core/video-player.d.ts +7 -0
- package/build/core/video-player.js +22 -0
- package/build/core/video-source.d.ts +3 -0
- package/build/core/video-source.js +20 -0
- package/build/core/video-thumbnail.d.ts +4 -0
- package/build/core/video-thumbnail.js +3 -0
- package/build/core/video-view.d.ts +18 -0
- package/build/core/video-view.js +63 -0
- package/build/core/view-types.d.ts +90 -0
- package/build/core/view-types.js +1 -0
- package/build/react/index.d.ts +4 -0
- package/build/react/index.js +4 -0
- package/build/react/use-video-player.d.ts +7 -0
- package/build/react/use-video-player.js +11 -0
- package/build/react/video-view.d.ts +13 -0
- package/build/react/video-view.js +10 -0
- package/build/solid/index.d.ts +3 -0
- package/build/solid/index.js +4 -0
- package/build/solid/use-video-player.d.ts +8 -0
- package/build/solid/use-video-player.js +11 -0
- package/build/solid/video-view.d.ts +33 -0
- package/build/solid/video-view.js +6 -0
- package/build/svelte/index.d.ts +5 -0
- package/build/svelte/index.js +5 -0
- package/build/svelte/use-video-player.svelte.d.ts +10 -0
- package/build/svelte/use-video-player.svelte.js +11 -0
- package/build/svelte/video-airplay-button.svelte +12 -0
- package/build/svelte/video-airplay-button.svelte.d.ts +4 -0
- package/build/svelte/video-view.svelte +25 -0
- package/build/svelte/video-view.svelte.d.ts +9 -0
- package/build/vue/index.d.ts +3 -0
- package/build/vue/index.js +4 -0
- package/build/vue/use-video-player.d.ts +8 -0
- package/build/vue/use-video-player.js +16 -0
- package/build/vue/video-view.d.ts +5 -0
- package/build/vue/video-view.js +14 -0
- package/build-ngc/angular/index.d.ts +4 -0
- package/build-ngc/angular/index.js +6 -0
- package/build-ngc/angular/index.js.map +1 -0
- package/build-ngc/angular/inject-video-player.d.ts +4 -0
- package/build-ngc/angular/inject-video-player.js +7 -0
- package/build-ngc/angular/inject-video-player.js.map +1 -0
- package/build-ngc/angular/video-airplay-button/index.d.ts +15 -0
- package/build-ngc/angular/video-airplay-button/index.js +37 -0
- package/build-ngc/angular/video-airplay-button/index.js.map +1 -0
- package/build-ngc/angular/video-view/index.d.ts +20 -0
- package/build-ngc/angular/video-view/index.js +56 -0
- package/build-ngc/angular/video-view/index.js.map +1 -0
- package/build-ngc/core/constants.d.ts +12 -0
- package/build-ngc/core/constants.js +14 -0
- package/build-ngc/core/constants.js.map +1 -0
- package/build-ngc/core/index.d.ts +10 -0
- package/build-ngc/core/index.js +9 -0
- package/build-ngc/core/index.js.map +1 -0
- package/build-ngc/core/native-module.d.ts +10 -0
- package/build-ngc/core/native-module.js +4 -0
- package/build-ngc/core/native-module.js.map +1 -0
- package/build-ngc/core/player-types.d.ts +221 -0
- package/build-ngc/core/player-types.js +2 -0
- package/build-ngc/core/player-types.js.map +1 -0
- package/build-ngc/core/video-airplay-button.d.ts +4 -0
- package/build-ngc/core/video-airplay-button.js +30 -0
- package/build-ngc/core/video-airplay-button.js.map +1 -0
- package/build-ngc/core/video-module.d.ts +12 -0
- package/build-ngc/core/video-module.js +22 -0
- package/build-ngc/core/video-module.js.map +1 -0
- package/build-ngc/core/video-player-controller.d.ts +15 -0
- package/build-ngc/core/video-player-controller.js +22 -0
- package/build-ngc/core/video-player-controller.js.map +1 -0
- package/build-ngc/core/video-player.d.ts +7 -0
- package/build-ngc/core/video-player.js +23 -0
- package/build-ngc/core/video-player.js.map +1 -0
- package/build-ngc/core/video-source.d.ts +3 -0
- package/build-ngc/core/video-source.js +21 -0
- package/build-ngc/core/video-source.js.map +1 -0
- package/build-ngc/core/video-thumbnail.d.ts +4 -0
- package/build-ngc/core/video-thumbnail.js +4 -0
- package/build-ngc/core/video-thumbnail.js.map +1 -0
- package/build-ngc/core/video-view.d.ts +18 -0
- package/build-ngc/core/video-view.js +64 -0
- package/build-ngc/core/video-view.js.map +1 -0
- package/build-ngc/core/view-types.d.ts +90 -0
- package/build-ngc/core/view-types.js +2 -0
- package/build-ngc/core/view-types.js.map +1 -0
- package/native-link.json +31 -0
- package/package.json +144 -3
- package/src/angular/index.ts +6 -0
- package/src/angular/inject-video-player.ts +20 -0
- package/src/angular/video-airplay-button/index.ts +39 -0
- package/src/angular/video-view/index.ts +58 -0
- package/src/core/constants.ts +16 -0
- package/src/core/index.ts +56 -0
- package/src/core/native-module.ts +16 -0
- package/src/core/player-types.ts +245 -0
- package/src/core/video-airplay-button.ts +45 -0
- package/src/core/video-module.ts +25 -0
- package/src/core/video-player-controller.ts +50 -0
- package/src/core/video-player.ts +38 -0
- package/src/core/video-source.ts +21 -0
- package/src/core/video-thumbnail.ts +7 -0
- package/src/core/video-view.ts +107 -0
- package/src/core/view-types.ts +114 -0
- package/src/react/index.ts +6 -0
- package/src/react/use-video-player.ts +22 -0
- package/src/react/video-view.ts +33 -0
- package/src/solid/index.ts +5 -0
- package/src/solid/use-video-player.ts +24 -0
- package/src/solid/video-view.ts +22 -0
- package/src/svelte/index.ts +7 -0
- package/src/svelte/svelte-ambient.d.ts +3 -0
- package/src/svelte/svelte-compile.test-helper.ts +6 -0
- package/src/svelte/use-video-player.svelte.ts +27 -0
- package/src/svelte/video-airplay-button.svelte +12 -0
- package/src/svelte/video-view.svelte +25 -0
- package/src/vue/index.ts +5 -0
- package/src/vue/use-video-player.ts +31 -0
- package/src/vue/video-view.ts +21 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/angular/index.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAE7F,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Signal } from '@angular/core';
|
|
2
|
+
import type { IVideoPlayerBuilderOptions, IVideoSource, VideoPlayer } from '../core';
|
|
3
|
+
/** Released with the injection context, `setup` runs once on each new player */
|
|
4
|
+
export declare const injectVideoPlayer: (source: () => IVideoSource, setup?: (player: VideoPlayer) => void, options?: () => IVideoPlayerBuilderOptions | undefined) => Signal<VideoPlayer>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Angular twin of `useVideoPlayer`, `injectX` shape matching `injectAudioPlayer`
|
|
2
|
+
import { createResourceHook } from '@symbiote-native/angular';
|
|
3
|
+
import { createVideoPlayerController } from '../core/video-player-controller';
|
|
4
|
+
const injectPlayerResource = createResourceHook(createVideoPlayerController);
|
|
5
|
+
/** Released with the injection context, `setup` runs once on each new player */
|
|
6
|
+
export const injectVideoPlayer = (source, setup, options) => injectPlayerResource(() => [source(), options?.(), setup]);
|
|
7
|
+
//# sourceMappingURL=inject-video-player.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inject-video-player.js","sourceRoot":"","sources":["../../src/angular/inject-video-player.ts"],"names":[],"mappings":"AAAA,iFAAiF;AAGjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAO9E,MAAM,oBAAoB,GAAG,kBAAkB,CAAC,2BAA2B,CAAC,CAAC;AAE7E,gFAAgF;AAChF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,MAA0B,EAC1B,KAAqC,EACrC,OAAsD,EACjC,EAAE,CACvB,oBAAoB,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NativeViewBase } from '@symbiote-native/angular';
|
|
2
|
+
import type { IDescriptor } from '@symbiote-native/components';
|
|
3
|
+
import type { IVideoAirPlayButtonProps } from '../../core';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
declare const AIRPLAY_INPUTS: readonly ["tint", "activeTint", "prioritizeVideoDevices", "onBeginPresentingRoutes", "onEndPresentingRoutes"];
|
|
6
|
+
export interface VideoAirPlayButton extends Partial<Pick<IVideoAirPlayButtonProps, (typeof AIRPLAY_INPUTS)[number]>> {
|
|
7
|
+
}
|
|
8
|
+
/** Angular twin of `expo-video`'s `VideoAirPlayButton`, a plain view off iOS */
|
|
9
|
+
export declare class VideoAirPlayButton extends NativeViewBase {
|
|
10
|
+
protected readonly propNames: readonly ["tint", "activeTint", "prioritizeVideoDevices", "onBeginPresentingRoutes", "onEndPresentingRoutes"];
|
|
11
|
+
protected renderView(props: object): IDescriptor | null;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VideoAirPlayButton, never>;
|
|
13
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<VideoAirPlayButton, "VideoAirPlayButton", never, { "tint": { "alias": "tint"; "required": false; }; "activeTint": { "alias": "activeTint"; "required": false; }; "prioritizeVideoDevices": { "alias": "prioritizeVideoDevices"; "required": false; }; "onBeginPresentingRoutes": { "alias": "onBeginPresentingRoutes"; "required": false; }; "onEndPresentingRoutes": { "alias": "onEndPresentingRoutes"; "required": false; }; }, {}, never, never, true, never>;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { DescriptorOutlet, NativeViewBase } from '@symbiote-native/angular';
|
|
3
|
+
import { renderVideoAirPlayButton } from '../../core';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
// One list is the inputs of the component and the props it hands to the native view
|
|
6
|
+
const AIRPLAY_INPUTS = [
|
|
7
|
+
'tint',
|
|
8
|
+
'activeTint',
|
|
9
|
+
'prioritizeVideoDevices',
|
|
10
|
+
'onBeginPresentingRoutes',
|
|
11
|
+
'onEndPresentingRoutes',
|
|
12
|
+
];
|
|
13
|
+
/** Angular twin of `expo-video`'s `VideoAirPlayButton`, a plain view off iOS */
|
|
14
|
+
export class VideoAirPlayButton extends NativeViewBase {
|
|
15
|
+
propNames = AIRPLAY_INPUTS;
|
|
16
|
+
renderView(props) {
|
|
17
|
+
return renderVideoAirPlayButton(props);
|
|
18
|
+
}
|
|
19
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: VideoAirPlayButton, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
20
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: VideoAirPlayButton, isStandalone: true, selector: "VideoAirPlayButton", inputs: { tint: "tint", activeTint: "activeTint", prioritizeVideoDevices: "prioritizeVideoDevices", onBeginPresentingRoutes: "onBeginPresentingRoutes", onEndPresentingRoutes: "onEndPresentingRoutes" }, usesInheritance: true, ngImport: i0, template: `@if (descriptor; as node) {
|
|
21
|
+
<symbiote-descriptor-outlet [node]="node" />
|
|
22
|
+
}`, isInline: true, dependencies: [{ kind: "component", type: DescriptorOutlet, selector: "symbiote-descriptor-outlet", inputs: ["node"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
23
|
+
}
|
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: VideoAirPlayButton, decorators: [{
|
|
25
|
+
type: Component,
|
|
26
|
+
args: [{
|
|
27
|
+
selector: 'VideoAirPlayButton',
|
|
28
|
+
standalone: true,
|
|
29
|
+
imports: [DescriptorOutlet],
|
|
30
|
+
inputs: [...AIRPLAY_INPUTS],
|
|
31
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
32
|
+
template: `@if (descriptor; as node) {
|
|
33
|
+
<symbiote-descriptor-outlet [node]="node" />
|
|
34
|
+
}`,
|
|
35
|
+
}]
|
|
36
|
+
}] });
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/angular/video-airplay-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;;AAGtD,oFAAoF;AACpF,MAAM,cAAc,GAAG;IACrB,MAAM;IACN,YAAY;IACZ,wBAAwB;IACxB,yBAAyB;IACzB,uBAAuB;CACf,CAAC;AAQX,gFAAgF;AAWhF,MAAM,OAAO,kBAAmB,SAAQ,cAAc;IACxB,SAAS,GAAG,cAAc,CAAC;IAEpC,UAAU,CAAC,KAAa;QACzC,OAAO,wBAAwB,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;uGALU,kBAAkB;2FAAlB,kBAAkB,+SAJnB;;IAER,4DALQ,gBAAgB;;2FAOf,kBAAkB;kBAV9B,SAAS;mBAAC;oBACT,QAAQ,EAAE,oBAAoB;oBAC9B,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,MAAM,EAAE,CAAC,GAAG,cAAc,CAAC;oBAC3B,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,QAAQ,EAAE;;IAER;iBACH"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NativeViewBase } from '@symbiote-native/angular';
|
|
2
|
+
import type { IDescriptor } from '@symbiote-native/components';
|
|
3
|
+
import type { IVideoViewProps } from '../../core';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
declare const VIDEO_VIEW_INPUTS: readonly ["player", "nativeControls", "contentFit", "fullscreenOptions", "showsTimecodes", "requiresLinearPlayback", "buttonOptions", "surfaceType", "contentPosition", "onPictureInPictureStart", "onPictureInPictureStop", "allowsPictureInPicture", "startsPictureInPictureAutomatically", "allowsVideoFrameAnalysis", "onFullscreenEnter", "onFullscreenExit", "onFirstFrameRender", "useExoShutter"];
|
|
6
|
+
export interface VideoView extends Partial<Pick<IVideoViewProps, (typeof VIDEO_VIEW_INPUTS)[number]>> {
|
|
7
|
+
}
|
|
8
|
+
/** Angular twin of `expo-video`'s `VideoView` */
|
|
9
|
+
export declare class VideoView extends NativeViewBase {
|
|
10
|
+
private readonly view;
|
|
11
|
+
readonly enterFullscreen: () => Promise<void>;
|
|
12
|
+
readonly exitFullscreen: () => Promise<void>;
|
|
13
|
+
readonly startPictureInPicture: () => Promise<void>;
|
|
14
|
+
readonly stopPictureInPicture: () => Promise<void>;
|
|
15
|
+
protected readonly propNames: readonly ["player", "nativeControls", "contentFit", "fullscreenOptions", "showsTimecodes", "requiresLinearPlayback", "buttonOptions", "surfaceType", "contentPosition", "onPictureInPictureStart", "onPictureInPictureStop", "allowsPictureInPicture", "startsPictureInPictureAutomatically", "allowsVideoFrameAnalysis", "onFullscreenEnter", "onFullscreenExit", "onFirstFrameRender", "useExoShutter"];
|
|
16
|
+
protected renderView(props: object): IDescriptor | null;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VideoView, never>;
|
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<VideoView, "VideoView", never, { "player": { "alias": "player"; "required": false; }; "nativeControls": { "alias": "nativeControls"; "required": false; }; "contentFit": { "alias": "contentFit"; "required": false; }; "fullscreenOptions": { "alias": "fullscreenOptions"; "required": false; }; "showsTimecodes": { "alias": "showsTimecodes"; "required": false; }; "requiresLinearPlayback": { "alias": "requiresLinearPlayback"; "required": false; }; "buttonOptions": { "alias": "buttonOptions"; "required": false; }; "surfaceType": { "alias": "surfaceType"; "required": false; }; "contentPosition": { "alias": "contentPosition"; "required": false; }; "onPictureInPictureStart": { "alias": "onPictureInPictureStart"; "required": false; }; "onPictureInPictureStop": { "alias": "onPictureInPictureStop"; "required": false; }; "allowsPictureInPicture": { "alias": "allowsPictureInPicture"; "required": false; }; "startsPictureInPictureAutomatically": { "alias": "startsPictureInPictureAutomatically"; "required": false; }; "allowsVideoFrameAnalysis": { "alias": "allowsVideoFrameAnalysis"; "required": false; }; "onFullscreenEnter": { "alias": "onFullscreenEnter"; "required": false; }; "onFullscreenExit": { "alias": "onFullscreenExit"; "required": false; }; "onFirstFrameRender": { "alias": "onFirstFrameRender"; "required": false; }; "useExoShutter": { "alias": "useExoShutter"; "required": false; }; }, {}, never, never, true, never>;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { DescriptorOutlet, NativeViewBase } from '@symbiote-native/angular';
|
|
3
|
+
import { createVideoView } from '../../core';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
// One list is the inputs of the component and the props it hands to the native view
|
|
6
|
+
const VIDEO_VIEW_INPUTS = [
|
|
7
|
+
'player',
|
|
8
|
+
'nativeControls',
|
|
9
|
+
'contentFit',
|
|
10
|
+
'fullscreenOptions',
|
|
11
|
+
'showsTimecodes',
|
|
12
|
+
'requiresLinearPlayback',
|
|
13
|
+
'buttonOptions',
|
|
14
|
+
'surfaceType',
|
|
15
|
+
'contentPosition',
|
|
16
|
+
'onPictureInPictureStart',
|
|
17
|
+
'onPictureInPictureStop',
|
|
18
|
+
'allowsPictureInPicture',
|
|
19
|
+
'startsPictureInPictureAutomatically',
|
|
20
|
+
'allowsVideoFrameAnalysis',
|
|
21
|
+
'onFullscreenEnter',
|
|
22
|
+
'onFullscreenExit',
|
|
23
|
+
'onFirstFrameRender',
|
|
24
|
+
'useExoShutter',
|
|
25
|
+
];
|
|
26
|
+
/** Angular twin of `expo-video`'s `VideoView` */
|
|
27
|
+
export class VideoView extends NativeViewBase {
|
|
28
|
+
view = createVideoView(() => this.hostNode());
|
|
29
|
+
// The functions of the view are members of the component, a `@ViewChild` reaches them
|
|
30
|
+
enterFullscreen = this.view.handle.enterFullscreen;
|
|
31
|
+
exitFullscreen = this.view.handle.exitFullscreen;
|
|
32
|
+
startPictureInPicture = this.view.handle.startPictureInPicture;
|
|
33
|
+
stopPictureInPicture = this.view.handle.stopPictureInPicture;
|
|
34
|
+
propNames = VIDEO_VIEW_INPUTS;
|
|
35
|
+
renderView(props) {
|
|
36
|
+
return this.view.render(props);
|
|
37
|
+
}
|
|
38
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: VideoView, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
39
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: VideoView, isStandalone: true, selector: "VideoView", inputs: { player: "player", nativeControls: "nativeControls", contentFit: "contentFit", fullscreenOptions: "fullscreenOptions", showsTimecodes: "showsTimecodes", requiresLinearPlayback: "requiresLinearPlayback", buttonOptions: "buttonOptions", surfaceType: "surfaceType", contentPosition: "contentPosition", onPictureInPictureStart: "onPictureInPictureStart", onPictureInPictureStop: "onPictureInPictureStop", allowsPictureInPicture: "allowsPictureInPicture", startsPictureInPictureAutomatically: "startsPictureInPictureAutomatically", allowsVideoFrameAnalysis: "allowsVideoFrameAnalysis", onFullscreenEnter: "onFullscreenEnter", onFullscreenExit: "onFullscreenExit", onFirstFrameRender: "onFirstFrameRender", useExoShutter: "useExoShutter" }, usesInheritance: true, ngImport: i0, template: `@if (descriptor; as node) {
|
|
40
|
+
<symbiote-descriptor-outlet [node]="node" />
|
|
41
|
+
}`, isInline: true, dependencies: [{ kind: "component", type: DescriptorOutlet, selector: "symbiote-descriptor-outlet", inputs: ["node"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
42
|
+
}
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: VideoView, decorators: [{
|
|
44
|
+
type: Component,
|
|
45
|
+
args: [{
|
|
46
|
+
selector: 'VideoView',
|
|
47
|
+
standalone: true,
|
|
48
|
+
imports: [DescriptorOutlet],
|
|
49
|
+
inputs: [...VIDEO_VIEW_INPUTS],
|
|
50
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
51
|
+
template: `@if (descriptor; as node) {
|
|
52
|
+
<symbiote-descriptor-outlet [node]="node" />
|
|
53
|
+
}`,
|
|
54
|
+
}]
|
|
55
|
+
}] });
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/angular/video-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE5E,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;;AAG7C,oFAAoF;AACpF,MAAM,iBAAiB,GAAG;IACxB,QAAQ;IACR,gBAAgB;IAChB,YAAY;IACZ,mBAAmB;IACnB,gBAAgB;IAChB,wBAAwB;IACxB,eAAe;IACf,aAAa;IACb,iBAAiB;IACjB,yBAAyB;IACzB,wBAAwB;IACxB,wBAAwB;IACxB,qCAAqC;IACrC,0BAA0B;IAC1B,mBAAmB;IACnB,kBAAkB;IAClB,oBAAoB;IACpB,eAAe;CACP,CAAC;AAMX,iDAAiD;AAWjD,MAAM,OAAO,SAAU,SAAQ,cAAc;IAC1B,IAAI,GAAG,eAAe,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAE/D,sFAAsF;IAC7E,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;IACnD,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;IACjD,qBAAqB,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC;IAC/D,oBAAoB,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC;IAE1C,SAAS,GAAG,iBAAiB,CAAC;IAEvC,UAAU,CAAC,KAAa;QACzC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;uGAbU,SAAS;2FAAT,SAAS,o0BAJV;;IAER,4DALQ,gBAAgB;;2FAOf,SAAS;kBAVrB,SAAS;mBAAC;oBACT,QAAQ,EAAE,WAAW;oBACrB,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,MAAM,EAAE,CAAC,GAAG,iBAAiB,CAAC;oBAC9B,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,QAAQ,EAAE;;IAER;iBACH"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const VIDEO_MODULE_NAME = "ExpoVideo";
|
|
2
|
+
/** Upstream's label for its `UnavailabilityError` */
|
|
3
|
+
export declare const VIDEO_PACKAGE_NAME = "expo-video";
|
|
4
|
+
export declare const VIDEO_VIEW_NAMES: {
|
|
5
|
+
/** The one iOS view */
|
|
6
|
+
readonly video: "VideoView";
|
|
7
|
+
/** The Android default, renders into a `SurfaceView` */
|
|
8
|
+
readonly surface: "SurfaceVideoView";
|
|
9
|
+
/** Android, for overlapping views */
|
|
10
|
+
readonly texture: "TextureVideoView";
|
|
11
|
+
readonly airPlayButton: "VideoAirPlayButtonView";
|
|
12
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Apart from `native-module`, which resolves the module on import: the views need the name too
|
|
2
|
+
export const VIDEO_MODULE_NAME = 'ExpoVideo';
|
|
3
|
+
/** Upstream's label for its `UnavailabilityError` */
|
|
4
|
+
export const VIDEO_PACKAGE_NAME = 'expo-video';
|
|
5
|
+
export const VIDEO_VIEW_NAMES = {
|
|
6
|
+
/** The one iOS view */
|
|
7
|
+
video: 'VideoView',
|
|
8
|
+
/** The Android default, renders into a `SurfaceView` */
|
|
9
|
+
surface: 'SurfaceVideoView',
|
|
10
|
+
/** Android, for overlapping views */
|
|
11
|
+
texture: 'TextureVideoView',
|
|
12
|
+
airPlayButton: 'VideoAirPlayButtonView',
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAE/F,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC;AAE7C,qDAAqD;AACrD,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAC;AAE/C,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,uBAAuB;IACvB,KAAK,EAAE,WAAW;IAClB,wDAAwD;IACxD,OAAO,EAAE,kBAAkB;IAC3B,qCAAqC;IACrC,OAAO,EAAE,kBAAkB;IAC3B,aAAa,EAAE,wBAAwB;CAC/B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { VIDEO_MODULE_NAME } from './constants';
|
|
2
|
+
export type { IVideoAudioMixingMode, IVideoAudioTrack, IVideoBufferOptions, IVideoContentType, IVideoDrmOptions, IVideoDrmType, IVideoMetadata, IVideoPlayerBuilderOptions, IVideoPlayerError, IVideoPlayerEvents, IVideoPlayerStatus, IVideoRange, IVideoScrubbingModeOptions, IVideoSeekTolerance, IVideoSize, IVideoSource, IVideoSourceObject, IVideoSubtitleTrack, IVideoThumbnailOptions, IVideoTrack, VideoPlayer, } from './player-types';
|
|
3
|
+
export { createVideoPlayer } from './video-player';
|
|
4
|
+
export { createVideoPlayerController, type IVideoPlayerController, } from './video-player-controller';
|
|
5
|
+
export { clearVideoCacheAsync, getCurrentVideoCacheSize, isPictureInPictureSupported, setVideoCacheSizeAsync, } from './video-module';
|
|
6
|
+
export { parseSource } from './video-source';
|
|
7
|
+
export { VideoThumbnail } from './video-thumbnail';
|
|
8
|
+
export { createVideoView, type IVideoView, type IVideoViewHandle, } from './video-view';
|
|
9
|
+
export { renderVideoAirPlayButton, videoAirPlayButtonViewName, } from './video-airplay-button';
|
|
10
|
+
export type { IVideoAirPlayButtonProps, IVideoButtonOptions, IVideoContentFit, IVideoFullscreenOptions, IVideoFullscreenOrientation, IVideoKeepFullscreenOnPiPStop, IVideoSurfaceType, IVideoViewProps, } from './view-types';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { VIDEO_MODULE_NAME } from './constants';
|
|
2
|
+
export { createVideoPlayer } from './video-player';
|
|
3
|
+
export { createVideoPlayerController, } from './video-player-controller';
|
|
4
|
+
export { clearVideoCacheAsync, getCurrentVideoCacheSize, isPictureInPictureSupported, setVideoCacheSizeAsync, } from './video-module';
|
|
5
|
+
export { parseSource } from './video-source';
|
|
6
|
+
export { VideoThumbnail } from './video-thumbnail';
|
|
7
|
+
export { createVideoView, } from './video-view';
|
|
8
|
+
export { renderVideoAirPlayButton, videoAirPlayButtonViewName, } from './video-airplay-button';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAwBhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACL,2BAA2B,GAE5B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EACL,eAAe,GAGhB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { VideoPlayer, VideoThumbnail } from './player-types';
|
|
2
|
+
export type INativeVideoModule = {
|
|
3
|
+
VideoPlayer: typeof VideoPlayer;
|
|
4
|
+
VideoThumbnail: typeof VideoThumbnail;
|
|
5
|
+
isPictureInPictureSupported(): boolean;
|
|
6
|
+
setVideoCacheSizeAsync(sizeBytes: number): Promise<void>;
|
|
7
|
+
clearVideoCacheAsync(): Promise<void>;
|
|
8
|
+
getCurrentVideoCacheSize(): number;
|
|
9
|
+
};
|
|
10
|
+
export declare const expoVideo: INativeVideoModule;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-module.js","sourceRoot":"","sources":["../../src/core/native-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAYhD,MAAM,CAAC,MAAM,SAAS,GAAG,mBAAmB,CAC1C,iBAAiB,CAClB,CAAC"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import type { SharedObject, SharedRef } from 'expo-modules-core';
|
|
2
|
+
export type IVideoPlayerStatus = 'idle' | 'loading' | 'readyToPlay' | 'error';
|
|
3
|
+
export type IVideoContentType = 'auto' | 'progressive' | 'hls' | 'dash' | 'smoothStreaming';
|
|
4
|
+
export type IVideoDrmType = 'clearkey' | 'fairplay' | 'playready' | 'widevine';
|
|
5
|
+
export type IVideoDrmOptions = {
|
|
6
|
+
type: IVideoDrmType;
|
|
7
|
+
licenseServer: string;
|
|
8
|
+
headers?: Record<string, string>;
|
|
9
|
+
/** Android only */
|
|
10
|
+
multiKey?: boolean;
|
|
11
|
+
/** iOS only */
|
|
12
|
+
contentId?: string;
|
|
13
|
+
/** iOS only */
|
|
14
|
+
certificateUrl?: string;
|
|
15
|
+
/** iOS only */
|
|
16
|
+
base64CertificateData?: string;
|
|
17
|
+
};
|
|
18
|
+
export type IVideoMetadata = {
|
|
19
|
+
title?: string;
|
|
20
|
+
artist?: string;
|
|
21
|
+
artwork?: string;
|
|
22
|
+
};
|
|
23
|
+
export type IVideoSourceObject = {
|
|
24
|
+
uri?: string;
|
|
25
|
+
/** A `require`d asset, `uri` wins when both are set */
|
|
26
|
+
assetId?: number;
|
|
27
|
+
drm?: IVideoDrmOptions;
|
|
28
|
+
metadata?: IVideoMetadata;
|
|
29
|
+
headers?: Record<string, string>;
|
|
30
|
+
/** Caches the video on disk, off by default */
|
|
31
|
+
useCaching?: boolean;
|
|
32
|
+
contentType?: IVideoContentType;
|
|
33
|
+
};
|
|
34
|
+
/** A URI, a `require`d asset or an object, `null` unloads the player */
|
|
35
|
+
export type IVideoSource = string | number | null | IVideoSourceObject;
|
|
36
|
+
export type IVideoPlayerError = {
|
|
37
|
+
message: string;
|
|
38
|
+
};
|
|
39
|
+
export type IVideoAudioMixingMode = 'mixWithOthers' | 'duckOthers' | 'auto' | 'doNotMix';
|
|
40
|
+
export type IVideoBufferOptions = {
|
|
41
|
+
/** iOS only, in seconds */
|
|
42
|
+
readonly preferredForwardBufferDuration?: number;
|
|
43
|
+
/** iOS only */
|
|
44
|
+
readonly waitsToMinimizeStalling?: boolean;
|
|
45
|
+
/** Android only, in seconds */
|
|
46
|
+
readonly minBufferForPlayback?: number;
|
|
47
|
+
/** Android only, in bytes */
|
|
48
|
+
readonly maxBufferBytes?: number | null;
|
|
49
|
+
/** Android only */
|
|
50
|
+
readonly prioritizeTimeOverSizeThreshold?: boolean;
|
|
51
|
+
};
|
|
52
|
+
export type IVideoTextTrack = {
|
|
53
|
+
id?: string;
|
|
54
|
+
language: string;
|
|
55
|
+
label: string;
|
|
56
|
+
name?: string;
|
|
57
|
+
isDefault?: boolean;
|
|
58
|
+
autoSelect?: boolean;
|
|
59
|
+
};
|
|
60
|
+
export type IVideoSubtitleTrack = IVideoTextTrack;
|
|
61
|
+
export type IVideoAudioTrack = IVideoTextTrack;
|
|
62
|
+
export type IVideoSize = {
|
|
63
|
+
width: number;
|
|
64
|
+
height: number;
|
|
65
|
+
};
|
|
66
|
+
export type IVideoRange = 'sdr' | 'hlg' | 'pq';
|
|
67
|
+
export type IVideoTrack = {
|
|
68
|
+
id: string;
|
|
69
|
+
url: string | null;
|
|
70
|
+
size: IVideoSize;
|
|
71
|
+
mimeType: string | null;
|
|
72
|
+
isSupported: boolean;
|
|
73
|
+
bitrate: number | null;
|
|
74
|
+
averageBitrate: number | null;
|
|
75
|
+
peakBitrate: number | null;
|
|
76
|
+
frameRate: number | null;
|
|
77
|
+
videoRange: IVideoRange;
|
|
78
|
+
};
|
|
79
|
+
export type IVideoSeekTolerance = {
|
|
80
|
+
/** iOS only, in seconds */
|
|
81
|
+
toleranceBefore?: number;
|
|
82
|
+
/** iOS only, in seconds */
|
|
83
|
+
toleranceAfter?: number;
|
|
84
|
+
};
|
|
85
|
+
export type IVideoScrubbingModeOptions = {
|
|
86
|
+
/** Android only */
|
|
87
|
+
scrubbingModeEnabled?: boolean;
|
|
88
|
+
increaseCodecOperatingRate?: boolean;
|
|
89
|
+
enableDynamicScheduling?: boolean;
|
|
90
|
+
useDecodeOnlyFlag?: boolean;
|
|
91
|
+
allowSkippingMediaCodecFlush?: boolean;
|
|
92
|
+
};
|
|
93
|
+
/** Options of the Android player builder, applied before the native constructor runs */
|
|
94
|
+
export type IVideoPlayerBuilderOptions = {
|
|
95
|
+
/** In seconds */
|
|
96
|
+
seekBackwardIncrement?: number;
|
|
97
|
+
/** In seconds */
|
|
98
|
+
seekForwardIncrement?: number;
|
|
99
|
+
};
|
|
100
|
+
export type IVideoThumbnailOptions = {
|
|
101
|
+
maxWidth?: number;
|
|
102
|
+
maxHeight?: number;
|
|
103
|
+
};
|
|
104
|
+
export type IVideoPlayerEvents = {
|
|
105
|
+
statusChange(payload: {
|
|
106
|
+
status: IVideoPlayerStatus;
|
|
107
|
+
oldStatus?: IVideoPlayerStatus;
|
|
108
|
+
error?: IVideoPlayerError;
|
|
109
|
+
}): void;
|
|
110
|
+
playingChange(payload: {
|
|
111
|
+
isPlaying: boolean;
|
|
112
|
+
oldIsPlaying?: boolean;
|
|
113
|
+
}): void;
|
|
114
|
+
playbackRateChange(payload: {
|
|
115
|
+
playbackRate: number;
|
|
116
|
+
oldPlaybackRate?: number;
|
|
117
|
+
}): void;
|
|
118
|
+
volumeChange(payload: {
|
|
119
|
+
volume: number;
|
|
120
|
+
oldVolume?: number;
|
|
121
|
+
}): void;
|
|
122
|
+
mutedChange(payload: {
|
|
123
|
+
muted: boolean;
|
|
124
|
+
oldMuted?: boolean;
|
|
125
|
+
}): void;
|
|
126
|
+
playToEnd(): void;
|
|
127
|
+
timeUpdate(payload: {
|
|
128
|
+
currentTime: number;
|
|
129
|
+
currentLiveTimestamp: number | null;
|
|
130
|
+
currentOffsetFromLive: number | null;
|
|
131
|
+
bufferedPosition: number;
|
|
132
|
+
}): void;
|
|
133
|
+
sourceChange(payload: {
|
|
134
|
+
source: IVideoSource;
|
|
135
|
+
oldSource?: IVideoSource;
|
|
136
|
+
}): void;
|
|
137
|
+
availableSubtitleTracksChange(payload: {
|
|
138
|
+
availableSubtitleTracks: IVideoSubtitleTrack[];
|
|
139
|
+
oldAvailableSubtitleTracks?: IVideoSubtitleTrack[];
|
|
140
|
+
}): void;
|
|
141
|
+
subtitleTrackChange(payload: {
|
|
142
|
+
subtitleTrack: IVideoSubtitleTrack | null;
|
|
143
|
+
oldSubtitleTrack?: IVideoSubtitleTrack | null;
|
|
144
|
+
}): void;
|
|
145
|
+
availableAudioTracksChange(payload: {
|
|
146
|
+
availableAudioTracks: IVideoAudioTrack[];
|
|
147
|
+
oldAvailableAudioTracks?: IVideoAudioTrack[];
|
|
148
|
+
}): void;
|
|
149
|
+
audioTrackChange(payload: {
|
|
150
|
+
audioTrack: IVideoAudioTrack | null;
|
|
151
|
+
oldAudioTrack?: IVideoAudioTrack | null;
|
|
152
|
+
}): void;
|
|
153
|
+
videoTrackChange(payload: {
|
|
154
|
+
videoTrack: IVideoTrack | null;
|
|
155
|
+
oldVideoTrack?: IVideoTrack | null;
|
|
156
|
+
}): void;
|
|
157
|
+
sourceLoad(payload: {
|
|
158
|
+
videoSource: IVideoSource | null;
|
|
159
|
+
duration: number;
|
|
160
|
+
availableVideoTracks: IVideoTrack[];
|
|
161
|
+
availableSubtitleTracks: IVideoSubtitleTrack[];
|
|
162
|
+
availableAudioTracks: IVideoAudioTrack[];
|
|
163
|
+
}): void;
|
|
164
|
+
isExternalPlaybackActiveChange(payload: {
|
|
165
|
+
isExternalPlaybackActive: boolean;
|
|
166
|
+
oldIsExternalPlaybackActive?: boolean;
|
|
167
|
+
}): void;
|
|
168
|
+
};
|
|
169
|
+
/** The native thumbnail, `expo-image` takes it as an image source */
|
|
170
|
+
export declare class VideoThumbnail extends SharedRef<'image'> {
|
|
171
|
+
width: number;
|
|
172
|
+
height: number;
|
|
173
|
+
/** In seconds */
|
|
174
|
+
requestedTime: number;
|
|
175
|
+
/** In seconds, iOS only */
|
|
176
|
+
actualTime: number;
|
|
177
|
+
}
|
|
178
|
+
export declare class VideoPlayer extends SharedObject<IVideoPlayerEvents> {
|
|
179
|
+
readonly playing: boolean;
|
|
180
|
+
loop: boolean;
|
|
181
|
+
/** iOS only */
|
|
182
|
+
allowsExternalPlayback: boolean;
|
|
183
|
+
audioMixingMode: IVideoAudioMixingMode;
|
|
184
|
+
muted: boolean;
|
|
185
|
+
/** In seconds, assigning seeks */
|
|
186
|
+
currentTime: number;
|
|
187
|
+
readonly currentLiveTimestamp: number | null;
|
|
188
|
+
readonly currentOffsetFromLive: number | null;
|
|
189
|
+
targetOffsetFromLive: number;
|
|
190
|
+
readonly duration: number;
|
|
191
|
+
volume: number;
|
|
192
|
+
preservesPitch: boolean;
|
|
193
|
+
/** In seconds, `0` turns the `timeUpdate` event off */
|
|
194
|
+
timeUpdateEventInterval: number;
|
|
195
|
+
playbackRate: number;
|
|
196
|
+
keepScreenOnWhilePlaying: boolean;
|
|
197
|
+
readonly isLive: boolean;
|
|
198
|
+
readonly status: IVideoPlayerStatus;
|
|
199
|
+
showNowPlayingNotification: boolean;
|
|
200
|
+
staysActiveInBackground: boolean;
|
|
201
|
+
readonly bufferedPosition: number;
|
|
202
|
+
bufferOptions: IVideoBufferOptions;
|
|
203
|
+
subtitleTrack: IVideoSubtitleTrack | null;
|
|
204
|
+
audioTrack: IVideoAudioTrack | null;
|
|
205
|
+
readonly availableAudioTracks: IVideoAudioTrack[];
|
|
206
|
+
readonly availableSubtitleTracks: IVideoSubtitleTrack[];
|
|
207
|
+
readonly videoTrack: IVideoTrack | null;
|
|
208
|
+
readonly availableVideoTracks: IVideoTrack[];
|
|
209
|
+
readonly isExternalPlaybackActive: boolean;
|
|
210
|
+
seekTolerance: IVideoSeekTolerance;
|
|
211
|
+
scrubbingModeOptions: IVideoScrubbingModeOptions;
|
|
212
|
+
constructor(source: IVideoSource, useSynchronousReplace?: boolean, playerBuilderOptions?: IVideoPlayerBuilderOptions);
|
|
213
|
+
play(): void;
|
|
214
|
+
pause(): void;
|
|
215
|
+
/** On iOS it loads the asset on the main thread, prefer `replaceAsync` */
|
|
216
|
+
replace(source: IVideoSource, disableWarning?: boolean): void;
|
|
217
|
+
replaceAsync(source: IVideoSource): Promise<void>;
|
|
218
|
+
seekBy(seconds: number): void;
|
|
219
|
+
replay(): void;
|
|
220
|
+
generateThumbnailsAsync(times: number | number[], options?: IVideoThumbnailOptions): Promise<VideoThumbnail[]>;
|
|
221
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"player-types.js","sourceRoot":"","sources":["../../src/core/player-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IDescriptor } from '@symbiote-native/components';
|
|
2
|
+
export declare const videoAirPlayButtonViewName: () => string;
|
|
3
|
+
/** A plain view with the minimum size where the system route picker does not exist */
|
|
4
|
+
export declare function renderVideoAirPlayButton(props: object): IDescriptor;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Platform, requireNativeViewManager } from 'expo-modules-core';
|
|
2
|
+
import { el } from '@symbiote-native/components';
|
|
3
|
+
import { defineExpoNativeView } from '@symbiote-native/engine';
|
|
4
|
+
import { VIDEO_MODULE_NAME, VIDEO_VIEW_NAMES } from './constants';
|
|
5
|
+
// Регистрация идёт при рендере: побочный эффект барреля теряется в release
|
|
6
|
+
const airPlayButton = defineExpoNativeView(requireNativeViewManager, VIDEO_MODULE_NAME, VIDEO_VIEW_NAMES.airPlayButton);
|
|
7
|
+
export const videoAirPlayButtonViewName = airPlayButton.name;
|
|
8
|
+
const MIN_SIZE = { minWidth: 30, minHeight: 30 };
|
|
9
|
+
// What only the native route picker takes, the plain fallback view must not get it
|
|
10
|
+
const AIRPLAY_ONLY_PROPS = new Set([
|
|
11
|
+
'tint',
|
|
12
|
+
'activeTint',
|
|
13
|
+
'prioritizeVideoDevices',
|
|
14
|
+
'onBeginPresentingRoutes',
|
|
15
|
+
'onEndPresentingRoutes',
|
|
16
|
+
]);
|
|
17
|
+
function isAirPlayAvailable() {
|
|
18
|
+
return (Platform.select({ ios: true, default: false }) &&
|
|
19
|
+
airPlayButton.ensureRegistered());
|
|
20
|
+
}
|
|
21
|
+
/** A plain view with the minimum size where the system route picker does not exist */
|
|
22
|
+
export function renderVideoAirPlayButton(props) {
|
|
23
|
+
const style = [MIN_SIZE, Reflect.get(props, 'style')];
|
|
24
|
+
if (isAirPlayAvailable()) {
|
|
25
|
+
return el(airPlayButton.name(), { ...props, style });
|
|
26
|
+
}
|
|
27
|
+
const viewProps = Object.entries(props).filter(([key]) => !AIRPLAY_ONLY_PROPS.has(key));
|
|
28
|
+
return el('view', { ...Object.fromEntries(viewProps), style });
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=video-airplay-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-airplay-button.js","sourceRoot":"","sources":["../../src/core/video-airplay-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,EAAE,EAAE,MAAM,6BAA6B,CAAC;AAEjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGlE,2EAA2E;AAC3E,MAAM,aAAa,GAAG,oBAAoB,CACxC,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,CAAC,aAAa,CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,aAAa,CAAC,IAAI,CAAC;AAE7D,MAAM,QAAQ,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;AAEjD,mFAAmF;AACnF,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAS;IACzC,MAAM;IACN,YAAY;IACZ,wBAAwB;IACxB,yBAAyB;IACzB,uBAAuB;CACuC,CAAC,CAAC;AAElE,SAAS,kBAAkB;IACzB,OAAO,CACL,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAC9C,aAAa,CAAC,gBAAgB,EAAE,CACjC,CAAC;AACJ,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,wBAAwB,CAAC,KAAa;IACpD,MAAM,KAAK,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;IACtD,IAAI,kBAAkB,EAAE,EAAE,CAAC;QACzB,OAAO,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACvD,CAAC;IACD,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAC5C,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,CACxC,CAAC;IACF,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Whether the device supports Picture in Picture */
|
|
2
|
+
export declare function isPictureInPictureSupported(): boolean;
|
|
3
|
+
/** Clears the video cache, only while no `VideoPlayer` exists */
|
|
4
|
+
export declare function clearVideoCacheAsync(): Promise<void>;
|
|
5
|
+
/**
|
|
6
|
+
* Sets the cache size in bytes, 1GB by default, and the value persists
|
|
7
|
+
*
|
|
8
|
+
* Only while no `VideoPlayer` exists, and the real size may be slightly larger
|
|
9
|
+
*/
|
|
10
|
+
export declare function setVideoCacheSizeAsync(sizeBytes: number): Promise<void>;
|
|
11
|
+
/** The space the video cache occupies, in bytes */
|
|
12
|
+
export declare function getCurrentVideoCacheSize(): number;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { expoVideo } from './native-module';
|
|
2
|
+
/** Whether the device supports Picture in Picture */
|
|
3
|
+
export function isPictureInPictureSupported() {
|
|
4
|
+
return expoVideo.isPictureInPictureSupported();
|
|
5
|
+
}
|
|
6
|
+
/** Clears the video cache, only while no `VideoPlayer` exists */
|
|
7
|
+
export function clearVideoCacheAsync() {
|
|
8
|
+
return expoVideo.clearVideoCacheAsync();
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Sets the cache size in bytes, 1GB by default, and the value persists
|
|
12
|
+
*
|
|
13
|
+
* Only while no `VideoPlayer` exists, and the real size may be slightly larger
|
|
14
|
+
*/
|
|
15
|
+
export function setVideoCacheSizeAsync(sizeBytes) {
|
|
16
|
+
return expoVideo.setVideoCacheSizeAsync(sizeBytes);
|
|
17
|
+
}
|
|
18
|
+
/** The space the video cache occupies, in bytes */
|
|
19
|
+
export function getCurrentVideoCacheSize() {
|
|
20
|
+
return expoVideo.getCurrentVideoCacheSize();
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=video-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-module.js","sourceRoot":"","sources":["../../src/core/video-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,qDAAqD;AACrD,MAAM,UAAU,2BAA2B;IACzC,OAAO,SAAS,CAAC,2BAA2B,EAAE,CAAC;AACjD,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,oBAAoB;IAClC,OAAO,SAAS,CAAC,oBAAoB,EAAE,CAAC;AAC1C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,SAAiB;IACtD,OAAO,SAAS,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC;AACrD,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,wBAAwB;IACtC,OAAO,SAAS,CAAC,wBAAwB,EAAE,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IResourceController } from '@symbiote-native/engine';
|
|
2
|
+
import type { IVideoPlayerBuilderOptions, IVideoSource, VideoPlayer } from './player-types';
|
|
3
|
+
type IVideoPlayerKey = {
|
|
4
|
+
source: IVideoSource;
|
|
5
|
+
options?: IVideoPlayerBuilderOptions;
|
|
6
|
+
};
|
|
7
|
+
export type IVideoPlayerController = {
|
|
8
|
+
/** `setup` runs only on a player this call creates */
|
|
9
|
+
resolve: (source: IVideoSource, options?: IVideoPlayerBuilderOptions, setup?: (player: VideoPlayer) => void) => VideoPlayer;
|
|
10
|
+
flushDispose: IResourceController<IVideoPlayerKey, VideoPlayer>['flushDispose'];
|
|
11
|
+
dispose: IResourceController<IVideoPlayerKey, VideoPlayer>['dispose'];
|
|
12
|
+
};
|
|
13
|
+
/** Twin of `useVideoPlayer`'s releasing shared object, one per mounted owner */
|
|
14
|
+
export declare function createVideoPlayerController(): IVideoPlayerController;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createJsonKeyedResourceController } from '@symbiote-native/engine';
|
|
2
|
+
import { createVideoPlayer } from './video-player';
|
|
3
|
+
import { parseSource } from './video-source';
|
|
4
|
+
/** Twin of `useVideoPlayer`'s releasing shared object, one per mounted owner */
|
|
5
|
+
export function createVideoPlayerController() {
|
|
6
|
+
// The latest setup, it is not part of the key and must not recreate the player
|
|
7
|
+
let latestSetup;
|
|
8
|
+
const controller = createJsonKeyedResourceController(key => {
|
|
9
|
+
const player = createVideoPlayer(key.source, key.options);
|
|
10
|
+
latestSetup?.(player);
|
|
11
|
+
return player;
|
|
12
|
+
}, player => player.release());
|
|
13
|
+
return {
|
|
14
|
+
resolve: (source, options, setup) => {
|
|
15
|
+
latestSetup = setup;
|
|
16
|
+
return controller.resolve({ source: parseSource(source), options });
|
|
17
|
+
},
|
|
18
|
+
flushDispose: controller.flushDispose,
|
|
19
|
+
dispose: controller.dispose,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=video-player-controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-player-controller.js","sourceRoot":"","sources":["../../src/core/video-player-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAE,MAAM,yBAAyB,CAAC;AAO5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAkB7C,gFAAgF;AAChF,MAAM,UAAU,2BAA2B;IACzC,+EAA+E;IAC/E,IAAI,WAAwD,CAAC;IAC7D,MAAM,UAAU,GAAG,iCAAiC,CAIlD,GAAG,CAAC,EAAE;QACJ,MAAM,MAAM,GAAG,iBAAiB,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;QAC1D,WAAW,EAAE,CAAC,MAAM,CAAC,CAAC;QACtB,OAAO,MAAM,CAAC;IAChB,CAAC,EACD,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAC3B,CAAC;IACF,OAAO;QACL,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;YAClC,WAAW,GAAG,KAAK,CAAC;YACpB,OAAO,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;QACtE,CAAC;QACD,YAAY,EAAE,UAAU,CAAC,YAAY;QACrC,OAAO,EAAE,UAAU,CAAC,OAAO;KAC5B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IVideoPlayerBuilderOptions, IVideoSource, VideoPlayer } from './player-types';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a player that does not release automatically, call `release()` when done
|
|
4
|
+
*
|
|
5
|
+
* The adapter hooks release it on unmount
|
|
6
|
+
*/
|
|
7
|
+
export declare function createVideoPlayer(source: IVideoSource, playerBuilderOptions?: IVideoPlayerBuilderOptions): VideoPlayer;
|