@gcorevideo/player 0.0.3 → 0.0.5

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.
@@ -1,29 +0,0 @@
1
- import { Core, UICorePlugin } from "@clappr/core";
2
- import "@clappr/plugins";
3
-
4
- declare module "@clappr/plugins" {
5
- declare type MediaControlOptions = {
6
- hideMediaControlDelay?: number;
7
- chromeless?: boolean;
8
- source?: string;
9
- sources?: string[];
10
- baseUrl?: string;
11
- disableKeyboardShortcuts?: boolean;
12
- width?: number;
13
- height?: number;
14
- persistConfig?: boolean; // TODO
15
- focusElement?: HTMLElement;
16
- hideVolumeBar?: boolean;
17
- parentElement?: HTMLElement;
18
- mediacontrol?: {
19
- buttons: string;
20
- seekbar: string;
21
- }
22
- }
23
-
24
- // declare class MediaControl extends UICorePlugin {
25
- // constructor(core: Core);
26
-
27
- // configure(options: MediaControlOptions): void;
28
- // }
29
- }
@@ -1,44 +0,0 @@
1
- import "clappr-zepto";
2
-
3
- declare module "clappr-zepto" {
4
- declare type ZeptoResult = {
5
- bind: (event: string, handler: (...args: any[]) => void) => void;
6
- unbind: (event: string, handler: (...args: any[]) => void) => void;
7
- // on: (event: string, handler: (...args: any[]) => void) => void;
8
- // off: (event: string, handler: (...args: any[]) => void) => void;
9
- find: (selector: string) => ZeptoResult;
10
- slice: (start: number, end?: number) => ZeptoResult;
11
- // get: () => HTMLElement[];
12
- get: (index: number) => HTMLElement[] | HTMLElement | null;
13
-
14
- append: (element: HTMLElement | string | ZeptoResult) => void;
15
- remove: () => void;
16
- empty: () => void;
17
-
18
- attr: (name: string, value: string) => void;
19
- // css: (property: string, value: string | number) => void;
20
- css: (styles: Record<string, string | number>) => void;
21
- data: (name: string, value: unknown) => void;
22
- // html: () => string;
23
- html: (value: string) => void;
24
- // text: () => string;
25
- text: (value: string) => void;
26
-
27
- show: () => void;
28
- hide: () => void;
29
-
30
- addClass: (className: string) => void;
31
- removeClass: (className: string) => void;
32
- hasClass: (className: string) => boolean;
33
- toggleClass: (className: string) => void;
34
-
35
- offset: () => { top: number; left: number };
36
- width: () => number;
37
- height: () => number;
38
- };
39
-
40
- declare const $: ((selector: string | Element | Document | ZeptoResult) => ZeptoResult) & {
41
- extend(target: Record<string, any>, ...sources: Record<string, any>[]): Record<string, any>;
42
- extend(deep: true, target: Record<string, any>, ...sources: Record<string, any>[]): Record<string, any>;
43
- };
44
- }
@@ -1,39 +0,0 @@
1
- import { Browser } from '@clappr/core';
2
- import canAutoPlay from 'can-autoplay';
3
-
4
- import { reportError, trace } from "../trace/index.js";
5
-
6
- export type CanAutoplayResult = {
7
- autoPlay: boolean;
8
- muted: boolean;
9
- }
10
-
11
- export default async function (): Promise<CanAutoplayResult> {
12
- let autoPlay = false;
13
- let muted = false;
14
-
15
- trace("canAutoplay enter");
16
-
17
- try {
18
- const autoplay = await canAutoPlay.video();
19
-
20
- if (autoplay.result) {
21
- autoPlay = true;
22
- } else {
23
- const checkObj = Browser.isiOS ? { muted: true, inline: true } : { muted: true };
24
- const mute = await canAutoPlay.video(checkObj);
25
-
26
- if (!mute.result) {
27
- autoPlay = false;
28
- } else {
29
- muted = true;
30
- autoPlay = true;
31
- }
32
- }
33
- } catch (e) {
34
- reportError(e);
35
- }
36
-
37
- trace("canAutoplay leave", { autoPlay, muted });
38
- return { autoPlay, muted };
39
- }