From 00455ba1fb36e236cf72369c21a6201a4483a553 Mon Sep 17 00:00:00 2001 From: Johannes Lumpe Date: Wed, 8 Apr 2015 18:44:28 +0300 Subject: [PATCH] Added check for asset url --- Video.ios.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Video.ios.js b/Video.ios.js index 1c8ab5aa..193128e8 100644 --- a/Video.ios.js +++ b/Video.ios.js @@ -14,6 +14,8 @@ var deepDiffer = require('deepDiffer'); var Video = React.createClass({ propTypes: { + // should probably be a shape + source: PropTypes.object, style: StyleSheetPropType(VideoStylePropTypes), source: PropTypes.object, resizeMode: PropTypes.string, @@ -55,13 +57,14 @@ var Video = React.createClass({ var style = flattenStyle([styles.base, this.props.style]); var source = this.props.source; var isNetwork = !!(source.uri && source.uri.match(/^https?:/)); + var isAsset = !!(source.uri && source.uri.match(/^assets-library:/)); var resizeMode; if (this.props.resizeMode === VideoResizeMode.stretch) { resizeMode = NativeModules.VideoManager.ScaleToFill; } else if (this.props.resizeMode === VideoResizeMode.contain) { resizeMode = NativeModules.VideoManager.ScaleAspectFit; - } else if (this.props.resizeMode == VideoResizeMode.cover) { + } else if (this.props.resizeMode === VideoResizeMode.cover) { resizeMode = NativeModules.VideoManager.ScaleAspectFill; } else { resizeMode = NativeModules.VideoManager.ScaleNone; @@ -73,6 +76,7 @@ var Video = React.createClass({ src: { uri: source.uri, isNetwork, + isAsset, type: source.type || 'mp4' }, onLoad: this._onLoad,