react-player
Advanced tools
Comparing version 1.10.0 to 1.11.0
@@ -7,2 +7,13 @@ ### Changelog | ||
#### [v1.11.0](https://github.com/CookPete/react-player/compare/v1.10.0...v1.11.0) | ||
> 10 April 2019 | ||
- Soundcloud - fix autoplay delegation [`#614`](https://github.com/CookPete/react-player/pull/614) | ||
- Implemented onBufferEnd cb prop for FilePlayer, YouTube and Facebook [`#615`](https://github.com/CookPete/react-player/pull/615) | ||
- Add on error callback to wistia player [`#617`](https://github.com/CookPete/react-player/pull/617) | ||
- align typings for seekTo method with code [`#619`](https://github.com/CookPete/react-player/pull/619) | ||
- Really really small typo in README.md [`#606`](https://github.com/CookPete/react-player/pull/606) | ||
- Add issue template [`ba6c274`](https://github.com/CookPete/react-player/commit/ba6c2747f18c5d005866b88bca58a9f2342611a1) | ||
#### [v1.10.0](https://github.com/CookPete/react-player/compare/v1.9.3...v1.10.0) | ||
@@ -9,0 +20,0 @@ |
@@ -101,2 +101,3 @@ import * as React from 'react'; | ||
onBuffer?(): void; | ||
onBufferEnd?(): void; | ||
onEnded?(): void; | ||
@@ -117,3 +118,3 @@ onEnablePIP?(): void; | ||
static removeCustomPlayers(): void; | ||
seekTo(fraction: number): void; | ||
seekTo(amount: number, type?: 'seconds' | 'fraction'): void; | ||
getCurrentTime(): number; | ||
@@ -120,0 +121,0 @@ getDuration(): number; |
@@ -84,2 +84,3 @@ 'use strict'; | ||
_this2.player.subscribe('startedBuffering', _this2.props.onBuffer); | ||
_this2.player.subscribe('finishedBuffering', _this2.props.onBufferEnd); | ||
_this2.player.subscribe('error', _this2.props.onError); | ||
@@ -86,0 +87,0 @@ if (!_this2.props.muted) { |
@@ -159,2 +159,4 @@ 'use strict'; | ||
onPlay = _props.onPlay, | ||
onBuffer = _props.onBuffer, | ||
onBufferEnd = _props.onBufferEnd, | ||
onPause = _props.onPause, | ||
@@ -168,2 +170,4 @@ onEnded = _props.onEnded, | ||
this.player.addEventListener('play', onPlay); | ||
this.player.addEventListener('waiting', onBuffer); | ||
this.player.addEventListener('playing', onBufferEnd); | ||
this.player.addEventListener('pause', onPause); | ||
@@ -187,2 +191,4 @@ this.player.addEventListener('seeked', this.onSeek); | ||
onPlay = _props2.onPlay, | ||
onBuffer = _props2.onBuffer, | ||
onBufferEnd = _props2.onBufferEnd, | ||
onPause = _props2.onPause, | ||
@@ -195,2 +201,4 @@ onEnded = _props2.onEnded, | ||
this.player.removeEventListener('play', onPlay); | ||
this.player.removeEventListener('waiting', onBuffer); | ||
this.player.removeEventListener('playing', onBufferEnd); | ||
this.player.removeEventListener('pause', onPause); | ||
@@ -197,0 +205,0 @@ this.player.removeEventListener('seeked', this.onSeek); |
@@ -149,3 +149,4 @@ 'use strict'; | ||
style: style, | ||
frameBorder: 0 | ||
frameBorder: 0, | ||
allow: 'autoplay' | ||
}); | ||
@@ -152,0 +153,0 @@ } |
@@ -74,3 +74,4 @@ 'use strict'; | ||
onEnded = _props.onEnded, | ||
config = _props.config; | ||
config = _props.config, | ||
onError = _props.onError; | ||
@@ -97,3 +98,3 @@ (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function () { | ||
}); | ||
}); | ||
}, onError); | ||
} | ||
@@ -100,0 +101,0 @@ }, { |
@@ -72,2 +72,3 @@ 'use strict'; | ||
onBuffer = _this$props.onBuffer, | ||
onBufferEnd = _this$props.onBufferEnd, | ||
onEnded = _this$props.onEnded, | ||
@@ -83,3 +84,6 @@ onReady = _this$props.onReady, | ||
if (data === PLAYING) onPlay(); | ||
if (data === PLAYING) { | ||
onPlay(); | ||
onBufferEnd(); | ||
} | ||
if (data === PAUSED) onPause(); | ||
@@ -86,0 +90,0 @@ if (data === BUFFERING) onBuffer(); |
@@ -85,2 +85,3 @@ 'use strict'; | ||
onBuffer: func, | ||
onBufferEnd: func, | ||
onEnded: func, | ||
@@ -180,2 +181,3 @@ onError: func, | ||
onBuffer: function onBuffer() {}, | ||
onBufferEnd: function onBufferEnd() {}, | ||
onEnded: function onEnded() {}, | ||
@@ -182,0 +184,0 @@ onError: function onError() {}, |
{ | ||
"name": "react-player", | ||
"version": "1.10.0", | ||
"version": "1.11.0", | ||
"description": "A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia and DailyMotion", | ||
@@ -5,0 +5,0 @@ "main": "lib/ReactPlayer.js", |
@@ -95,2 +95,3 @@ <h1 align='center'> | ||
`onBuffer` | Called when media starts buffering | ||
`onBufferEnd` | Called when media has finished buffering<br /> ◦ Works for files, YouTube and Facebook | ||
`onSeek` | Called when media seeks with `seconds` parameter | ||
@@ -165,3 +166,3 @@ `onEnded` | Called when media finishes playing<br /> ◦ Does not fire when `loop` is set to `true` | ||
------ | ----------- | ||
`seekTo(amount, type)` | Seek to the given number of seconds, or fraction if `amount` is between `0` and `1`<br /> ◦ `type` parameter lets you specify `'seconds'` or `'fraction'` to override deault behaviour | ||
`seekTo(amount, type)` | Seek to the given number of seconds, or fraction if `amount` is between `0` and `1`<br /> ◦ `type` parameter lets you specify `'seconds'` or `'fraction'` to override default behaviour | ||
`getCurrentTime()` | Returns the number of seconds that have been played<br /> ◦ Returns `null` if unavailable | ||
@@ -168,0 +169,0 @@ `getSecondsLoaded()` | Returns the number of seconds that have been loaded<br /> ◦ Returns `null` if unavailable or unsupported |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
1739199
32
4070
354