@vkontakte/videoplayer-interactive 1.0.39-dev.2be73400.0 → 1.0.39-dev.6edf3cda.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.
@@ -11,6 +11,8 @@ declare class TextControl extends Control {
11
11
  onResize(): void;
12
12
  updateShadowStyles(): void;
13
13
  toggleBlinkAnimation(): void;
14
+ setShowTimeRange(): void;
15
+ updateFillAnimationDimensions(): void;
14
16
  onError(): void;
15
17
  }
16
18
  export {};
@@ -23,7 +23,7 @@ export type ControlCreateViewParams = {
23
23
  export type Options = Record<string, unknown>;
24
24
  export type ControlOptions = {
25
25
  isTouch: boolean;
26
- features: Pick<AnimationsFeatureToggles, 'controlsExpectTimeBlinkAnimation' | 'controlsTapPlace'>;
26
+ features: Pick<AnimationsFeatureToggles, 'controlsExpectTimeBlinkAnimation' | 'controlsTapPlace' | 'controlsFillAnimation'>;
27
27
  };
28
28
  export declare function isControlOptions(options: Options): options is ControlOptions;
29
29
  type ControlEventCallbackParams = {
@@ -17,6 +17,8 @@ export declare const utils: {
17
17
  toggleBlinkAnimation(enable?: boolean): void;
18
18
  syncBlinkAnimation(refAnim: HTMLElement): void;
19
19
  onBlinkHovering(): void;
20
+ setShowTimeRange(): void;
21
+ updateFillAnimationDimensions(): void;
20
22
  onProgress(): void;
21
23
  onResize(): void;
22
24
  container: import("@vkontakte/videoplayer-shared").Nullable<{
@@ -41,6 +43,9 @@ export declare const utils: {
41
43
  removeListeners(): void;
42
44
  }>;
43
45
  createButtonControl: import("./controls").ControlCreator<import("./controls").ControlOptions, {
46
+ startTime?: number;
47
+ endTime?: number;
48
+ controlFillAnimation?: import("./utils/ControlFillAnimation").ControlFillAnimation;
44
49
  createView({ parentElement, callbacks }: import("./controls").ControlCreateViewParams): void;
45
50
  registerEvents(): void;
46
51
  disable(): void;
@@ -49,7 +54,9 @@ export declare const utils: {
49
54
  toggleBlinkAnimation(enable?: boolean): void;
50
55
  syncBlinkAnimation(refAnim: HTMLElement): void;
51
56
  onBlinkHovering(): void;
52
- onProgress(): void;
57
+ updateFillAnimationDimensions(): void;
58
+ setShowTimeRange(startTime: number, endTime: number): void;
59
+ onProgress(currentTime: number): void;
53
60
  onResize(): void;
54
61
  updateShadowStyles(): void;
55
62
  container: import("@vkontakte/videoplayer-shared").Nullable<{
@@ -19,6 +19,7 @@ export type AnimationsFeatureToggles = Partial<{
19
19
  areaControlShadow: boolean;
20
20
  controlsExpectTimeBlinkAnimation: boolean;
21
21
  controlsTapPlace: boolean;
22
+ controlsFillAnimation: boolean;
22
23
  }>;
23
24
  export interface IInteractiveOptions {
24
25
  parentElement: HTMLElement;
@@ -45,6 +46,7 @@ export interface IInteractiveOptions {
45
46
  * @deprecated
46
47
  * */
47
48
  disableControlsOnPause?: boolean;
49
+ disableTextControlContainerVisibilityEvents?: boolean;
48
50
  isTouch?: boolean;
49
51
  animationsFeatureToggles?: AnimationsFeatureToggles;
50
52
  }
@@ -0,0 +1,34 @@
1
+ export type Options = {
2
+ startTime: number;
3
+ endTime: number;
4
+ rotateAngle: number;
5
+ borderRadius: string;
6
+ debug?: boolean;
7
+ };
8
+ export declare class ControlFillAnimation {
9
+ fillAnimationElement: HTMLDivElement;
10
+ private fillAnimationFillerElement;
11
+ private fillAnimationFillerWrapperElement;
12
+ private startTime;
13
+ private endTime;
14
+ private shouldFillHeight;
15
+ private widthExpansionCoef;
16
+ private isDebug;
17
+ private fromLeft;
18
+ private useSkew;
19
+ private rotateAngle;
20
+ constructor(opts: Options);
21
+ updateDimension(opts: {
22
+ width: number;
23
+ height: number;
24
+ borderWidth: number;
25
+ }): void;
26
+ updateAnimation(currentTime: number): void;
27
+ /**
28
+ * Когда мы применяем scew для контрол, расстояние между крайними left & right
29
+ * точками становится больше. Это значит, что нужно увеличивать
30
+ * элемент-заполнитель, чтобы он заполнял контрол полностью. Этот метод
31
+ * возвращает коэффцицент увеличения для элемента-заполнителя.
32
+ */
33
+ private calcWidthExpansionCoef;
34
+ }
@@ -0,0 +1 @@
1
+ export * from './ControlFillAnimation';
@@ -0,0 +1,12 @@
1
+ export declare const CONTROL_FILL_ANIMATION_CLASSNAME_PREFIX = "interactive-control-fill-animation";
2
+ export declare const controlFillAnimationClassNames: {
3
+ common: string;
4
+ fillerWrapper: string;
5
+ filler: string;
6
+ fillHeight: string;
7
+ fillWidth: string;
8
+ fromTop: string;
9
+ fromBottom: string;
10
+ fromLeft: string;
11
+ fromRight: string;
12
+ };
@@ -23,6 +23,7 @@ type ConstructorArg = {
23
23
  disabledControls$: IValueSubject<boolean>;
24
24
  onRemove: () => void;
25
25
  onError: (error: CustomError) => void;
26
+ disableTextControlContainerVisibilityEvents?: boolean;
26
27
  };
27
28
  export declare class GameController {
28
29
  container: ChoiceContainer;
@@ -42,7 +43,8 @@ export declare class GameController {
42
43
  isSelectedContainerEvent: boolean;
43
44
  globalEvents: GlobalEvents;
44
45
  onError: ConstructorArg['onError'];
45
- constructor({ player, container, branches, selectBranches, interactiveEvents, globalEvents, globalEventEmitter, getContainerEventState, permanentTextControls, interactiveTimeOpenUri, disabledControls$, onRemove, onError, }: ConstructorArg);
46
+ disableTextControlContainerVisibilityEvents: boolean;
47
+ constructor({ player, container, branches, selectBranches, interactiveEvents, globalEvents, globalEventEmitter, getContainerEventState, permanentTextControls, interactiveTimeOpenUri, disabledControls$, onRemove, onError, disableTextControlContainerVisibilityEvents, }: ConstructorArg);
46
48
  private emitContainerVisibilityEvent;
47
49
  registerEvents(): void;
48
50
  hide: () => void;
@@ -1,2 +1,25 @@
1
+ /**
2
+ * use normalizeRadians before use
3
+ */
4
+ export declare function isPositiveXAxis(angle: number): angle is 0;
5
+ /**
6
+ * use normalizeRadians before use
7
+ */
8
+ export declare function isPositiveYAxis(angle: number): boolean;
9
+ /**
10
+ * use normalizeRadians before use
11
+ */
12
+ export declare function isNegativeXAxis(angle: number): boolean;
13
+ /**
14
+ * use normalizeRadians before use
15
+ */
16
+ export declare function isNegativeYAxis(angle: number): boolean;
17
+ /**
18
+ * normalizes to [0, 2π)
19
+ */
1
20
  export declare function normalizeRadians(rad: number): number;
21
+ /**
22
+ * use normalizeRadians before use
23
+ */
24
+ export declare function getQuadrant(rad: number): number | null;
2
25
  export declare function radiansToDegrees(rad: number): number;