react-video-renderer
Advanced tools
Comparing version 1.1.2 to 2.0.1
/// <reference types="react" /> | ||
import * as React from 'react'; | ||
import { Component, ReactNode } from 'react'; | ||
export declare type VideoStatus = 'loading' | 'playing' | 'paused' | 'errored'; | ||
export declare type VideoStatus = 'playing' | 'paused' | 'errored'; | ||
export declare type VideoError = MediaError | null; | ||
@@ -13,2 +13,3 @@ export interface VideoState { | ||
isMuted: boolean; | ||
isLoading: boolean; | ||
error?: VideoError; | ||
@@ -43,2 +44,3 @@ } | ||
isMuted: boolean; | ||
isLoading: boolean; | ||
error?: VideoError; | ||
@@ -48,3 +50,2 @@ } | ||
videoElement: HTMLVideoElement; | ||
statusBeforeLoading?: VideoStatus; | ||
state: VideoComponentState; | ||
@@ -51,0 +52,0 @@ constructor(props: VideoProps); |
@@ -29,2 +29,3 @@ "use strict"; | ||
_this.state = { | ||
isLoading: true, | ||
buffered: 0, | ||
@@ -57,5 +58,2 @@ currentTime: 0, | ||
var video = e.target; | ||
var currentStatus = _this.state.status; | ||
var statusBeforeLoading = _this.statusBeforeLoading; | ||
var status = currentStatus === 'loading' && statusBeforeLoading ? statusBeforeLoading : currentStatus; | ||
var _a = getVolumeFromVideo(video), volume = _a.volume, isMuted = _a.isMuted; | ||
@@ -65,3 +63,3 @@ _this.setState({ | ||
isMuted: isMuted, | ||
status: status, | ||
isLoading: false, | ||
currentTime: video.currentTime, | ||
@@ -129,2 +127,3 @@ duration: video.duration | ||
_this.setState({ | ||
isLoading: false, | ||
status: 'errored', | ||
@@ -135,7 +134,3 @@ error: video.error | ||
_this.onWaiting = function () { | ||
var status = _this.state.status; | ||
_this.statusBeforeLoading = status; | ||
_this.setState({ | ||
status: 'loading' | ||
}); | ||
_this.setState({ isLoading: true }); | ||
}; | ||
@@ -158,3 +153,3 @@ _this.videoElement = document.createElement('video'); | ||
get: function () { | ||
var _a = this.state, currentTime = _a.currentTime, volume = _a.volume, status = _a.status, duration = _a.duration, buffered = _a.buffered, isMuted = _a.isMuted, error = _a.error; | ||
var _a = this.state, currentTime = _a.currentTime, volume = _a.volume, status = _a.status, duration = _a.duration, buffered = _a.buffered, isMuted = _a.isMuted, isLoading = _a.isLoading, error = _a.error; | ||
return { | ||
@@ -167,2 +162,3 @@ currentTime: currentTime, | ||
isMuted: isMuted, | ||
isLoading: isLoading, | ||
error: error | ||
@@ -169,0 +165,0 @@ }; |
{ | ||
"name": "react-video-renderer", | ||
"version": "1.1.2", | ||
"version": "2.0.1", | ||
"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
14283
283