2016-12-01 87 views
0

當我在頁面上時,視頻是可見的,可以播放,就像我想要的一樣。當我按下它時,我打電話給presentFullscreenPlayer()功能,視頻消失,但仍然可以聽到它。試圖在反應原生視頻中全屏時視頻消失

視頻:

<TouchableHighlight style={styles.video} onPress={() => this.player.presentFullscreenPlayer()}> 
    <View> 
    <Video source={video} // Can be a URL or a local file. 
      ref={ref => this.player = ref} // Store reference 
      rate={1.0}      // 0 is paused, 1 is normal. 
      volume={1.0}     // 0 is muted, 1 is normal. 
      muted={false}     // Mutes the audio entirely. 
      paused={true}     // Pauses playback entirely. 
      resizeMode="cover"    // Fill the whole screen at aspect ratio. 
      repeat={false}     // Repeat forever. 
      playInBackground={false}  // Audio continues to play when app entering background. 
      playWhenInactive={false}  // [iOS] Video continues to play when control or notification center are shown. 
      progressUpdateInterval={250.0} // [iOS] Interval to fire onProgress (default to ~250ms) 
      onLoadStart={this.loadStart} // Callback when video starts to load 
      onLoad={() => { 
         this.player.seek(10); 
         }}  // Callback when video loads 
      onProgress={this.setTime}  // Callback every ~250ms with currentTime 
      onEnd={this.onEnd}    // Callback when playback finishes 
      onError={this.videoError}  // Callback when video cannot be loaded 
      style={styles.locatieVideo} /> 
    </View> 
</TouchableHighlight> 

我認爲我的風格可能是錯的,但我不會知道該怎麼用它做。

造型:

locatieVideo:{ 
    position: 'absolute', 
    top: 0, 
    left: 0, 
    width: 250, 
    height: 200, 
    zIndex: 501, 
    }, 
    video:{ 
    position: 'absolute', 
    top: 0, 
    left: 0, 
    right: 0, 
    bottom: 0, 
    zIndex: 500, 
    }, 

編輯:

我也注意到它得到全屏幕,但它停留在背景圖片後面。該頁面是使用react-native-router-flux創建的模塊。這與它有什麼關係?

回答

0

顯然功能this.player.presentFullscreenPlayer()在Android上不受支持。