0
ビデオコンポーネントのファンクション内にあるconsole.log()
の場合、ページのロード時に即座に呼び出されます。 onPress
がThouchableHighlight
のconsole.log()
も同時に呼び出されます。私はこのビデオのサムネイルをクリックするとこのページに行くためにActions.videoPlayer()
をrepo react-native-router-flux
から使いました。ビデオが終了した後にビデオの開始時に反応ネイティブビデオのonEndが呼び出されます
render() {
let video = require('../videos/HISTORISCHETUIN.mp4');
return (
<View>
<TouchableHighlight onPress={console.log("Test")}>
<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="stretch" // Fill the whole screen at aspect ratio.
repeat={true} // 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(30);
}} // Callback when video loads
onProgress={this.setTime} // Callback every ~250ms with currentTime
onEnd={console.log("Test")} // Callback when playback finishes
onError={this.videoError} // Callback when video cannot be loaded
style={styles.video} />
</View>
</TouchableHighlight>
</View>
)
}
なぜそれがconsole.log()
を呼び出すことはありませんか?私がビデオを押しても何もしません。
ああ、それは私の愚かなことです。..ありがとう。 –