mirror of
https://github.com/zoriya/react-native-video.git
synced 2026-05-06 22:06:38 +00:00
Merge branch 'master' of https://github.com/react-native-video/react-native-video into feat/add_new_events_on_tracks_changed
# Conflicts: # CHANGELOG.md # android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java # examples/basic/src/VideoPlayer.android.tsx
This commit is contained in:
15
Video.js
15
Video.js
@@ -294,16 +294,20 @@ export default class Video extends Component {
|
||||
let uri = source.uri || '';
|
||||
if (uri && uri.match(/^\//)) {
|
||||
uri = `file://${uri}`;
|
||||
} else if (uri === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!uri) {
|
||||
console.warn('Trying to load empty source.');
|
||||
console.log('Trying to load empty source.');
|
||||
}
|
||||
|
||||
const isNetwork = !!(uri && uri.match(/^https?:/));
|
||||
const isAsset = !!(uri && uri.match(/^(assets-library|ph|ipod-library|file|content|ms-appx|ms-appdata):/));
|
||||
const isNetwork = !!(uri && uri.match(/^https?:/i));
|
||||
const isAsset = !!(uri && uri.match(/^(assets-library|ph|ipod-library|file|content|ms-appx|ms-appdata):/i));
|
||||
|
||||
if ((uri || uri === '') && !isNetwork && !isAsset) {
|
||||
if (this.props.onError) {
|
||||
this.props.onError({error: {errorString: 'invalid url, player will stop', errorCode: 'INVALID_URL'}});
|
||||
}
|
||||
}
|
||||
|
||||
let nativeResizeMode;
|
||||
const RCTVideoInstance = this.getViewManagerConfig('RCTVideo');
|
||||
@@ -504,6 +508,7 @@ Video.propTypes = {
|
||||
reportBandwidth: PropTypes.bool,
|
||||
contentStartTime: PropTypes.number,
|
||||
disableFocus: PropTypes.bool,
|
||||
focusable: PropTypes.bool,
|
||||
disableBuffering: PropTypes.bool,
|
||||
controls: PropTypes.bool,
|
||||
audioOnly: PropTypes.bool,
|
||||
|
||||
Reference in New Issue
Block a user