react-video-renderer
Advanced tools
Comparing version 0.0.4 to 0.0.5
/// <reference types="react" /> | ||
import * as React from 'react'; | ||
import { Component, ReactNode } from 'react'; | ||
export declare type VideoStatus = 'playing' | 'paused'; | ||
export declare type VideoStatus = 'playing' | 'paused' | 'errored'; | ||
export interface VideoState { | ||
@@ -12,7 +12,9 @@ status: VideoStatus; | ||
} | ||
export declare type NavigateFunction = (time: number) => void; | ||
export declare type SetVolumeFunction = (volume: number) => void; | ||
export interface VideoActions { | ||
play: () => void; | ||
pause: () => void; | ||
navigate: (time: number) => void; | ||
setVolume: (volume: number) => void; | ||
navigate: NavigateFunction; | ||
setVolume: SetVolumeFunction; | ||
requestFullscreen: () => void; | ||
@@ -60,3 +62,4 @@ mute: () => void; | ||
onDurationChange: (e: any) => void; | ||
onError: () => void; | ||
render(): React.ReactNode; | ||
} |
@@ -106,2 +106,7 @@ "use strict"; | ||
}; | ||
_this.onError = function () { | ||
_this.setState({ | ||
status: 'errored' | ||
}); | ||
}; | ||
return _this; | ||
@@ -154,3 +159,3 @@ } | ||
var _b = this.props, src = _b.src, children = _b.children, autoPlay = _b.autoPlay, controls = _b.controls, preload = _b.preload; | ||
return children(React.createElement("video", { ref: this.saveVideoRef, src: src, preload: preload, controls: controls, autoPlay: autoPlay, onPlay: this.onPlay, onPause: this.onPause, onVolumeChange: this.onVolumeChange, onTimeUpdate: this.onTimeUpdate, onCanPlay: this.onCanPlay, onDurationChange: this.onDurationChange }), videoState, actions); | ||
return children(React.createElement("video", { ref: this.saveVideoRef, src: src, preload: preload, controls: controls, autoPlay: autoPlay, onPlay: this.onPlay, onPause: this.onPause, onVolumeChange: this.onVolumeChange, onTimeUpdate: this.onTimeUpdate, onCanPlay: this.onCanPlay, onDurationChange: this.onDurationChange, onError: this.onError }), videoState, actions); | ||
}; | ||
@@ -157,0 +162,0 @@ Video.defaultProps = { |
{ | ||
"name": "react-video-renderer", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "repository": "git@github.com:zzarcon/react-video-renderer.git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13004
249