Commit f6ee6a91 authored by Stanisław Chmiela's avatar Stanisław Chmiela
Browse files

Use API instead of prop to show and hide fullscreen player

parent 931ea75e
Loading
Loading
Loading
Loading
+8 −2
Changes for Video.js: 8 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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,
  },
});