diff --git a/Video.js b/Video.js index 287573a1..e068c84d 100644 --- a/Video.js +++ b/Video.js @@ -276,16 +276,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 && !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');