|
@@ -29,7 +29,8 @@ export default class CusVideo extends React.Component {
|
|
|
duration: 0.0,
|
|
|
currentTime: 0.0,
|
|
|
paused: false,
|
|
|
- wheel: false
|
|
|
+ wheel: false,
|
|
|
+ player_status_icon: require("../images/video/start.png")
|
|
|
};
|
|
|
|
|
|
render() {
|
|
@@ -82,11 +83,11 @@ export default class CusVideo extends React.Component {
|
|
|
>
|
|
|
<Image
|
|
|
style={[styles.player_pause_icon]}
|
|
|
- //source={require("../imgs/player_image_state_pause.png")}
|
|
|
+ source={this.state.player_status_icon}
|
|
|
/>
|
|
|
</TouchableOpacity>
|
|
|
</View>
|
|
|
- <View style={{ flex: 3 }}>
|
|
|
+ <View style={{ flex: 2 }}>
|
|
|
{/* //左侧当前播放时长 */}
|
|
|
<Text style={[styles.player_time]}>
|
|
|
{formatTime(this.state.currentTime)}
|
|
@@ -94,7 +95,7 @@ export default class CusVideo extends React.Component {
|
|
|
</View>
|
|
|
<View
|
|
|
style={{
|
|
|
- flex: 7,
|
|
|
+ flex: 9,
|
|
|
overflow: "hidden"
|
|
|
}}
|
|
|
>
|
|
@@ -106,21 +107,33 @@ export default class CusVideo extends React.Component {
|
|
|
touchUpCallBack={this.touch_up_callback.bind(this)}
|
|
|
/>
|
|
|
</View>
|
|
|
- <View style={{ flex: 3 }}>
|
|
|
+ <View style={{ flex: 2 }}>
|
|
|
{/* //右侧总时长 */}
|
|
|
<Text style={[styles.player_time]}>
|
|
|
{formatTime(this.state.duration)}
|
|
|
</Text>
|
|
|
</View>
|
|
|
- <TouchableOpacity
|
|
|
- style={{ flex: 1 }}
|
|
|
- onPress={() => this.presentFullscreenPlayer()}
|
|
|
+ <View
|
|
|
+ style={{
|
|
|
+ flex: 1,
|
|
|
+ alignItems: "center"
|
|
|
+ }}
|
|
|
>
|
|
|
- <View style={{ flex: 1 }}>
|
|
|
+ <TouchableOpacity
|
|
|
+ style={{
|
|
|
+ justifyContent: "center",
|
|
|
+ width: "100%",
|
|
|
+ height: "100%"
|
|
|
+ }}
|
|
|
+ onPress={() => this.presentFullscreenPlayer()}
|
|
|
+ >
|
|
|
{/* //放大按钮 */}
|
|
|
- <Image style={[styles.player_pause_icon]} />
|
|
|
- </View>
|
|
|
- </TouchableOpacity>
|
|
|
+ <Image
|
|
|
+ style={[styles.fullscreen_icon]}
|
|
|
+ source={require("../images/video/fullscreen.png")}
|
|
|
+ />
|
|
|
+ </TouchableOpacity>
|
|
|
+ </View>
|
|
|
</View>
|
|
|
</View>
|
|
|
);
|
|
@@ -159,11 +172,17 @@ export default class CusVideo extends React.Component {
|
|
|
}
|
|
|
}
|
|
|
pause() {
|
|
|
- this.setState({ paused: true });
|
|
|
+ this.setState({
|
|
|
+ paused: true,
|
|
|
+ player_status_icon: require("../images/video/start.png")
|
|
|
+ });
|
|
|
this.player_icon_index = 1;
|
|
|
}
|
|
|
start() {
|
|
|
- this.setState({ paused: false });
|
|
|
+ this.setState({
|
|
|
+ paused: false,
|
|
|
+ player_status_icon: require("../images/video/pause.png")
|
|
|
+ });
|
|
|
this.player_icon_index = 0;
|
|
|
}
|
|
|
showToast(params) {
|
|
@@ -204,15 +223,23 @@ const styles = StyleSheet.create({
|
|
|
width: "100%",
|
|
|
height: 50,
|
|
|
alignItems: "center",
|
|
|
+ justifyContent: "center",
|
|
|
bottom: 0
|
|
|
},
|
|
|
player_pause_icon: {
|
|
|
- width: "100%",
|
|
|
+ width: "80%",
|
|
|
resizeMode: "center",
|
|
|
- height: "80%",
|
|
|
+ height: "40%",
|
|
|
justifyContent: "center",
|
|
|
alignItems: "center",
|
|
|
- backgroundColor: "blue"
|
|
|
+ left: 5
|
|
|
+ },
|
|
|
+ fullscreen_icon: {
|
|
|
+ width: "80%",
|
|
|
+ resizeMode: "center",
|
|
|
+ height: "30%",
|
|
|
+ justifyContent: "center",
|
|
|
+ alignItems: "center"
|
|
|
},
|
|
|
player_time: {
|
|
|
fontSize: 18,
|