帖子
帖子
用户
博客
课程
12下一页
返回列表 发新帖
显示全部楼层
21
帖子
0
勋章
93
Y币

[BUG] moviePlayer 模块 moviePlayer.addEventListener 监听ios问题

[复制链接]
发表于 2019-10-15 17:45:52
ios:        addEventListener

点击放大和返回按钮监听一直返回
{"eventType":"clickGesture"}
不能返回
back 和 customBtns


          moviePlayer = api.require('moviePlayer');

          moviePlayer.open({
          rect:{
          x: 0,
          y: 0,
          w:api.winWidth,
          h:200
          },
                  texts: {
                  title:api.pageParam.section_name
                  },         
          styles:{
          head:{
          bg: 'rgba(0,0,0,0)',
          height: 44,
          y:20,
          title:{
          size:20,
          color:'#fff',
          width:100,
          leftMargin:50
          },
          backSize: 20,
          backImg:'widget://image/video/white_arrow.png',
          customButtons:[{
          w:17,
          h:20,
          rightMagin:14,
          img:'widget://image/video/right1.png',
          imgSelected:'widget://image/video/right1.png',  
          }]},
          foot:{  
          bg: 'rgba(0,0,0,0.5)',
          height: 44,
          palyBtn:{
          size: 20,
          playImg:'widget://image/video/play.png',
          pauseImg:'widget://image/video/play2.png',
          marginLeft:5
          },
          currentTimeLabel:{
          textSize:14,
          textColor:"#FFF",
          textWidth: 43,
          marginLeft:5
          },
          seekBar:{
          sliderImg:'widget://image/circle.png',
          sliderW : 20,
          sliderH : 20,
          progressColor: 'rgba(255,255,255,0.4)',
          progressSelected: 'rgba(255,255,255,1)',
          marginLeft:10,
          marginRight:10
          },
          totalTimeLabel:{
          textSize:14,
          textColor:"#FFF",
          textWidth: 43,
          marginRight:5
          },
          fullscreenBtn:{
          size:20,
          verticalImg:'widget://image/video/right2.png',                        
          horizontalImg:'widget://image/video/right22.png',               
          }
          }
          },
          path:'http://qiniu.youwang.online/1571111246241.mp4',
          autoPlay: true,
          autorotation:false,
          useGestureControl:false,
          isShowControlView:true,
          },function(ret, err){
             
                  console.log("||||"+JSON.stringify(ret))
              if(ret){
                  
                  isPlay=true;
                 moviePlayer.addEventListener(function(ret){
                        
                         console.log(JSON.stringify(ret));
                    if(ret && ret.eventType == 'back'){
//                        alert('点击back按钮'+JSON.stringify(ret));
                                api.closeWin();
                    }else if(ret && ret.eventType == 'customBtns'){
                             alert('下载'+JSON.stringify(ret));
                                                 
                            
                    }
                    
                  });                  
                  
                  
              }

                  });

1571132463(1).jpg
9
帖子
0
勋章
5634
Y币
同样的代码安卓可以运行不 ?
ios版本也发一下
21
帖子
0
勋章
93
Y币
马浩川 发表于 2019-10-16 09:45
同样的代码安卓可以运行不 ?
ios版本也发一下

就ios有问题,安卓没有问题。

11.4.1
12.3.1
13.1.2
9
帖子
0
勋章
5634
Y币
  apiready = function() {
      var moviePlayer = api.require('moviePlayer');
      moviePlayer.addEventListener(function(ret){
          if(ret && ret.eventType == 'back'){
              alert('点击back按钮');
          }
      });
    };

QQ图片20191016103925.png
21
帖子
0
勋章
93
Y币
马浩川 发表于 2019-10-16 10:39
apiready = function() {
      var moviePlayer = api.require('moviePlayer');
      moviePlayer.addE ...

用我的代码。测试一下,主要是 全屏按钮和右边的自定义按钮根本点击不到。
全屏观看之后点击返回按钮也是不灵敏。右边的自定义按钮压根就点不到。
9
帖子
0
勋章
5634
Y币
你试试我的代码吧,我测试的ios版本是13.1.2
<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>Hello APP</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <style>
        html,
        body {
            height: 100%;
        }

        .wrap {
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-flex-flow: column;
        }

        header {
            height: 44px;
            width: 100%;
            text-align: center;
            background-color: #81a9c3;
            color: #fff;
            line-height: 44px;
            font-size: 20px;
        }

        .flex-1 {
            -webkit-box-flex: 1;
            -webkit-flex: 1;
        }

        footer {
            height: 30px;
            width: 100%;
            background-color: #81a9c3;
            color: white;
            line-height: 30px;
            text-align: center;
        }

        h1 {
            padding: 20px;
        }
    </style>
</head>

<body>
    <h1 onclick="fn()">fn</h1>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript">
    apiready = function() {
      var moviePlayer = api.require('moviePlayer');
      moviePlayer.addEventListener(function(ret){
          if(ret && ret.eventType == 'back'){
              alert('点击back按钮');
          }
      });
    };

    function fn() {
        var moviePlayer = api.require('moviePlayer');
        alert(moviePlayer)
        moviePlayer.open({
            rect: {
                x: 0,
                y: 0,
                w: api.frameWidth,
                h: 300
            },
            enterPlayBtn: {
                size: 60, // 数字类型;按钮大小;默认:30
                iconPath: 'widget://image/back.png' // 字符串类型;图标路径;
            },
            styles: {
                head: {
                    bg: 'rgba(161,161,161,0.5)',
                    height: 44,
                    y: 20,
                    title: {
                        size: 20,
                        color: '#fff',
                        width: 40,
                        leftMargin: 10
                    },
                    backSize: 30,
                    backImg: 'widget://image/back.png',
                    customButtons: [{
                        w: 30,
                        h: 30,
                        rightMagin: 10,
                        img: 'widget://res/QQ.png',
                        imgSelected: 'fs://image/collectSelected.png',
                    }]
                },
                foot: {
                    bg: 'rgba(0,0,0,0.5)',
                    height: 44,
                    palyBtn: {
                        size: 20,
                        playImg: 'widget://image/play.png',
                        pauseImg: 'widget://image/pause.png',
                        marginLeft: 5
                    },
                    currentTimeLabel: {
                        textSize: 14,
                        textColor: "#FFF",
                        textWidth: 43,
                        marginLeft: 5
                    },
                    seekBar: {
                        sliderImg: 'widget://res/QQ.png',
                        sliderW: 20,
                        sliderH: 20,
                        progressColor: '#696969',
                        progressSelected: '#76EE00',
                        marginLeft: 10,
                        marginRight: 10
                    },
                    totalTimeLabel: {
                        textSize: 14,
                        textColor: "#FFF",
                        textWidth: 43,
                        marginRight: 5
                    },
                    fullscreenBtn: {
                        size: 20,
                        verticalImg: 'widget://res/QQ.png',
                        horizontalImg: 'widget://res/QQ.png',
                    }
                }
            },
            path: 'http://**.**2.z0.glb**.**/c1.1.mp4',
            autoPlay: false
        }, function(ret, err) {
            if (ret) {
               
            } else {
                alert(JSON.stringify(err));
            }

        });
    }
</script>

</html>
21
帖子
0
勋章
93
Y币
马浩川 发表于 2019-10-16 11:00
你试试我的代码吧,我测试的ios版本是13.1.2

现在的问题不是返回按钮的问题。是全屏按钮和右边之定义的按钮点击不到的问题啊= =你这个只是返回按钮= =。我这边代码返回按钮也是可以按到的。但是在你全屏之后返回按钮就按不到了
21
帖子
0
勋章
93
Y币
马浩川 发表于 2019-10-16 11:00
你试试我的代码吧,我测试的ios版本是13.1.2

现在右边的之定义按钮,怎么点监听都不会返回数据。全屏观看按钮需要点好多次才能点到一次
9
帖子
0
勋章
5634
Y币
在最新版ios上有点问题 我反馈一下
21
帖子
0
勋章
93
Y币
马浩川 发表于 2019-10-16 13:57
在最新版ios上有点问题 我反馈一下

多谢多谢多谢多谢多谢多谢多谢多谢多谢多谢多谢多谢多谢多谢
12下一页
您需要登录后才可以回帖 登录

本版积分规则