Reporting estimatedBandwidth

Reporting estimatedBandwidth
This commit is contained in:
sridhar
2018-08-25 21:53:11 +05:30
parent ff31bd1772
commit 6480a6462b
4 changed files with 70 additions and 6 deletions

View File

@@ -99,6 +99,12 @@ export default class Video extends Component {
}
};
_onBandwidthUpdate = (event) => {
if (this.props.onBandwidthUpdate) {
this.props.onBandwidthUpdate(event.nativeEvent);
}
};
_onSeek = (event) => {
if (this.state.showPoster && !this.props.audioOnly) {
this.setState({showPoster: false});
@@ -234,6 +240,7 @@ export default class Video extends Component {
onVideoSeek: this._onSeek,
onVideoEnd: this._onEnd,
onVideoBuffer: this._onBuffer,
onBandwidthUpdate: this._onBandwidthUpdate,
onTimedMetadata: this._onTimedMetadata,
onVideoAudioBecomingNoisy: this._onAudioBecomingNoisy,
onVideoFullscreenPlayerWillPresent: this._onFullscreenPlayerWillPresent,
@@ -294,6 +301,7 @@ Video.propTypes = {
onVideoBuffer: PropTypes.func,
onVideoError: PropTypes.func,
onVideoProgress: PropTypes.func,
onBandwidthUpdate: PropTypes.func,
onVideoSeek: PropTypes.func,
onVideoEnd: PropTypes.func,
onTimedMetadata: PropTypes.func,
@@ -363,6 +371,8 @@ Video.propTypes = {
playInBackground: PropTypes.bool,
playWhenInactive: PropTypes.bool,
ignoreSilentSwitch: PropTypes.oneOf(['ignore', 'obey']),
reportBandwidth: PropTypes.bool,
bandwidthUpdateInterval: PropTypes.number,
disableFocus: PropTypes.bool,
controls: PropTypes.bool,
audioOnly: PropTypes.bool,