From 8ebfa6e4dbacaf5f901d78b2a239712302fe90e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Chmiela?= Date: Thu, 31 Mar 2016 20:36:39 +0200 Subject: [PATCH] Export property from Objective-C to React --- RCTVideoManager.m | 1 + Video.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/RCTVideoManager.m b/RCTVideoManager.m index 7c0dfbc2..bcbd3f3e 100644 --- a/RCTVideoManager.m +++ b/RCTVideoManager.m @@ -43,6 +43,7 @@ RCT_EXPORT_VIEW_PROPERTY(volume, float); RCT_EXPORT_VIEW_PROPERTY(rate, float); RCT_EXPORT_VIEW_PROPERTY(seek, float); RCT_EXPORT_VIEW_PROPERTY(currentTime, float); +RCT_EXPORT_VIEW_PROPERTY(fullscreen, BOOL); - (NSDictionary *)constantsToExport { diff --git a/Video.js b/Video.js index cc763c37..b429bbfd 100644 --- a/Video.js +++ b/Video.js @@ -21,6 +21,7 @@ export default class Video extends Component { constructor(props, context) { super(props, context); this.seek = this.seek.bind(this); + this.goFullscreen = this.goFullscreen.bind(this); this._assignRoot = this._assignRoot.bind(this); this._onLoadStart = this._onLoadStart.bind(this); this._onLoad = this._onLoad.bind(this); @@ -38,6 +39,10 @@ export default class Video extends Component { this.setNativeProps({ seek: time }); } + goFullscreen() { + this.setNativeProps({ fullscreen: true }); + } + _assignRoot(component) { this._root = component; } @@ -134,6 +139,7 @@ Video.propTypes = { /* Native only */ src: PropTypes.object, seek: PropTypes.number, + fullscreen: PropTypes.bool, /* Wrapper component */ source: PropTypes.object,