Merge pull request #1478 from laurent22/master
Throw an error instead of crashing app when video source is empty
This commit is contained in:
commit
98eb7a3137
2
Video.js
2
Video.js
@ -227,6 +227,8 @@ export default class Video extends Component {
|
|||||||
uri = `file://${uri}`;
|
uri = `file://${uri}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!uri) throw new Error('Trying to load empty source.');
|
||||||
|
|
||||||
const isNetwork = !!(uri && uri.match(/^https?:/));
|
const isNetwork = !!(uri && uri.match(/^https?:/));
|
||||||
const isAsset = !!(uri && uri.match(/^(assets-library|ipod-library|file|content|ms-appx|ms-appdata):/));
|
const isAsset = !!(uri && uri.match(/^(assets-library|ipod-library|file|content|ms-appx|ms-appdata):/));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user