fix: improve initial test for checking url validity

This commit is contained in:
olivier bouillet 2022-10-02 21:33:03 +02:00
parent 6dd149b821
commit d67b3c45b5

View File

@ -285,7 +285,7 @@ export default class Video extends Component {
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 ((uri || uri === '') && !isNetwork && !isAsset) {
if (this.props.onError) {
this.props.onError({error: {errorString: 'invalid url, player will stop', errorCode: 'INVALID_URL'}});
}