From f6ee6a91a3dab23eea4d1a3e60843d50929966c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Chmiela?= Date: Fri, 1 Apr 2016 11:12:50 +0200 Subject: [PATCH] Use API instead of prop to show and hide fullscreen player --- Video.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Video.js b/Video.js index 2d40a955..60859b17 100644 --- a/Video.js +++ b/Video.js @@ -21,7 +21,8 @@ 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.presentFullscreenPlayer = this.presentFullscreenPlayer.bind(this); + this.dismissFullscreenPlayer = this.dismissFullscreenPlayer.bind(this); this._assignRoot = this._assignRoot.bind(this); this._onLoadStart = this._onLoadStart.bind(this); this._onLoad = this._onLoad.bind(this); @@ -43,10 +44,14 @@ export default class Video extends Component { this.setNativeProps({ seek: time }); } - goFullscreen() { + presentFullscreenPlayer() { this.setNativeProps({ fullscreen: true }); } + dismissFullscreenPlayer() { + this.setNativeProps({ fullscreen: false }); + } + _assignRoot(component) { this._root = component; } @@ -207,5 +212,6 @@ const RCTVideo = requireNativeComponent('RCTVideo', Video, { nativeOnly: { src: true, seek: true, + fullscreen: true, }, });