Browse Source

1.修改播放器
2.修改课程表界面全屏按物理返回键不做响应

zhangmengjie 5 years ago
parent
commit
38815d5a89
2 changed files with 8 additions and 19 deletions
  1. 8 4
      pages/components/CusVideo.js
  2. 0 15
      pages/components/SchedulePage.js

+ 8 - 4
pages/components/CusVideo.js

@@ -44,6 +44,7 @@ export default class CusVideo extends React.Component {
     duration: 0.0,
     currentTime: 0.0,
     paused: true,
+    onBuffer: true,
     wheel: false,
     isFull: false,
     needback: this.props.needback,
@@ -142,15 +143,11 @@ export default class CusVideo extends React.Component {
   }
 
   componentWillMount() {
-    if (this.state.pause) {
-    }
-
     this.videotouch = PanResponder.create({
       onStartShouldSetPanResponder: (evt, gestureState) => true,
       onStartShouldSetPanResponderCapture: (evt, gestureState) => true,
       onMoveShouldSetPanResponder: (evt, gestureState) => true,
       onMoveShouldSetPanResponderCapture: (evt, gestureState) => true,
-
       onPanResponderGrant: (evt, gestureState) => {
         this.pressStatus = true;
         this.config.changeY = evt.nativeEvent.pageY;
@@ -198,9 +195,16 @@ export default class CusVideo extends React.Component {
   onBuffer({ isBuffering }: { isBuffering: boolean }) {
     //true为正在加载,false为没有加载,此处给loading提示
     this.setState({
+      onBuffer: isBuffering,
       show_loading: isBuffering
     });
   }
+  isPlaying() {
+    if (this.state.onBuffer == false && this.state.paused == false) {
+      return true;
+    }
+    return false;
+  }
   onLoad = data => {
     //获取的是秒数
     this.setState({ duration: data.duration });

+ 0 - 15
pages/components/SchedulePage.js

@@ -234,8 +234,6 @@ export default class SchedulePage extends BasePage {
           show={this.state.video_show}
           uri={this.state.video_uri}
           ref={view => (this.video = view)}
-          needback={false}
-          videoback={() => alert("videoback")}
           videofullScreenPlayer={this.fullScreenPlayer.bind(this)}
           onError={this.onError.bind(this)}
           onEnd={this.onEnd.bind(this)}
@@ -276,19 +274,6 @@ export default class SchedulePage extends BasePage {
   }
   onBackAndroid() {
     if (this.state.isFull) {
-      Orientation.lockToPortrait();
-      this.setState({
-        // title_height: "6%",
-        video_frame_height: "32%",
-        // seat_height: "2%",
-        // flatlist_height: "60%",
-        x: this.state.videoImage_x,
-        y: this.state.videoImage_y,
-        video_width: this.state.videoImage_width,
-        video_height: this.state.videoImage_height,
-        statusbar_hidden: false,
-        isFull: false
-      });
       return true;
     } else {
     }