support for absolute path and file:// paths
This commit is contained in:
parent
7d9fdeb6e8
commit
95d67b011e
10
Video.ios.js
10
Video.ios.js
@ -67,8 +67,12 @@ var Video = React.createClass({
|
|||||||
render() {
|
render() {
|
||||||
var style = flattenStyle([styles.base, this.props.style]);
|
var style = flattenStyle([styles.base, this.props.style]);
|
||||||
var source = this.props.source;
|
var source = this.props.source;
|
||||||
var isNetwork = !!(source.uri && source.uri.match(/^https?:/));
|
var uri = source.uri;
|
||||||
var isAsset = !!(source.uri && source.uri.match(/^assets-library:/));
|
if (uri && uri.match(/^\//)) {
|
||||||
|
uri = 'file://' + uri;
|
||||||
|
}
|
||||||
|
var isNetwork = !!(uri && uri.match(/^https?:/));
|
||||||
|
var isAsset = !!(uri && uri.match(/^(assets-library|file):/));
|
||||||
|
|
||||||
var resizeMode;
|
var resizeMode;
|
||||||
if (this.props.resizeMode === VideoResizeMode.stretch) {
|
if (this.props.resizeMode === VideoResizeMode.stretch) {
|
||||||
@ -85,7 +89,7 @@ var Video = React.createClass({
|
|||||||
style,
|
style,
|
||||||
resizeMode: resizeMode,
|
resizeMode: resizeMode,
|
||||||
src: {
|
src: {
|
||||||
uri: source.uri,
|
uri: uri,
|
||||||
isNetwork,
|
isNetwork,
|
||||||
isAsset,
|
isAsset,
|
||||||
type: source.type || 'mp4'
|
type: source.type || 'mp4'
|
||||||
|
Loading…
Reference in New Issue
Block a user