소스 검색

1.修改播放器,不传onError和onEnd,就不调用方法。

zhangmengjie 5 년 전
부모
커밋
1fa20066ea
1개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 8 2
      pages/components/CusVideo.js

+ 8 - 2
pages/components/CusVideo.js

@@ -217,10 +217,16 @@ export default class CusVideo extends React.Component {
   };
 
   onError() {
-    this.props.onError();
+    if (this.props.onEnd == undefined) {
+    } else {
+      this.props.onError();
+    }
   }
   onEnd() {
-    this.props.onEnd();
+    if (this.props.onEnd == undefined) {
+    } else {
+      this.props.onEnd();
+    }
   }
   play() {
     //controller的play点击无法换图...