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

[BUG] polyvideo模块iOS闪退

[复制链接]
发表于 2015-11-11 17:08:06
如题:使用polyvideo模块编写了一个播放视频,安卓下没问题,ios下会闪退,不知道是什么原因?
代码如下:
var obj = api.require('polyVideo');
api.download({
   url: 'http://mobiledev**.**/uploads/test111.mkv',
   savePath: 'fs://download/testabss.mkv',
   report: false,
   cache: true,
   allowResume: true
}, function (ret, err){
   alert(JSON.stringify(ret))
   obj.open({
      rect: {
         x: 0,
         y: 0,
         w: 320,
         h: 240
      },
      vid:ret.savePath/*'02d7f2dc232a2760e985d3dae7d3f936_0'*/,
      autoPlay: true,
      fixedOn: api.frameName,
      fixed: false
   },function(ret1,err1){
      //var duration = ret1.duration;
      //var current = ret1.current;
      //alert(JSON.stringify(ret1))
      alert(JSON.stringify(err1))
   });
});
55
帖子
0
勋章
277
Y币
下载是成功的,就是开始播放的时候连错误都没有弹出,就崩溃了
5
帖子
0
勋章
1万+
Y币
日志找到应用Documents/APICloud/SaveFile/exceptionInfo这个文件,看下这个
55
帖子
0
勋章
277
Y币
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>content</key>
        <string>Exception name:NSRangeException\nException reason:*** -[__NSArrayM objectAtIndex:]: index 1 beyond bounds for empty array\nException stack\n\t0   CoreFoundation                      0x00000001851165b8 &lt;redacted&gt; + 160\n\t1   libobjc.A.dylib                     0x00000001958200e4 objc_exception_throw + 60\n\t2   CoreFoundation                      0x0000000184ffb62c &lt;redacted&gt; + 0\n\t3   UZApp                               0x00000001001e0e98 -[parserKeyXml initWithXmlPath:] + 256\n\t4   UZApp                               0x00000001001e1538 -[UZPolyv open:] + 532\n\t5   Foundation                          0x0000000185fe9df0 &lt;redacted&gt; + 372\n\t6   CoreFoundation                      0x00000001850ce9ec &lt;redacted&gt; + 24\n\t7   CoreFoundation                      0x00000001850cdc90 &lt;redacted&gt; + 264\n\t8   CoreFoundation                      0x00000001850cbd40 &lt;redacted&gt; + 712\n\t9   CoreFoundation                      0x0000000184ff90a4 CFRunLoopRunSpecific + 396\n\t10  GraphicsServices                    0x000000018e1a35a4 GSEventRunModal + 168\n\t11  UIKit                               0x000000018992e3c0 UIApplicationMain + 1488\n\t12  UZApp                               0x000000010014bab4 main + 92\n\t13  libdyld.dylib                       0x0000000195e8ea08 &lt;redacted&gt; + 4\n)</string>
        <key>timestamp</key>
        <integer>1447233314687</integer>
        <key>title</key>
        <string>*** -[__NSArrayM objectAtIndex:]: index 1 beyond bounds for empty array</string>
</dict>
</plist>
55
帖子
0
勋章
277
Y币
技术支持-M 发表于 2015-11-11 17:36
日志找到应用Documents/APICloud/SaveFile/exceptionInfo这个文件,看下这个

文件是这个,看不懂
55
帖子
0
勋章
277
Y币
技术支持-M 发表于 2015-11-11 17:36
日志找到应用Documents/APICloud/SaveFile/exceptionInfo这个文件,看下这个

我看了一下那个文件,好像是损坏了,为什么下载下来文件就坏了
5
帖子
0
勋章
1万+
Y币
阿坤. 发表于 2015-11-11 17:58
我看了一下那个文件,好像是损坏了,为什么下载下来文件就坏了

不太清楚,需要查下
55
帖子
0
勋章
277
Y币
技术支持-M 发表于 2015-11-11 19:24
不太清楚,需要查下

这个希望帮忙看一下,iOS每次到播放视频(调用open方法)的时候总是会闪退,不知道是什么原因?
55
帖子
0
勋章
277
Y币
技术支持-M 发表于 2015-11-11 19:24
不太清楚,需要查下

代码如下:
obj.open({
                        rect: {
                                x: 0,
                                y: 0,
                                w: 320,
                                h: 240
                        },
                        path: 'fs://download/111.mp4',
                        autoPlay: false,
                        fixedOn: api.frameName,
                        fixed: false
                }, function (ret1, err1){
                        //var duration = ret1.duration;
                        //var current = ret1.current;
                        //alert(JSON.stringify(ret1))
                        alert(JSON.stringify(err1))
                });
3
帖子
0
勋章
9
Y币
附上一个完整的demo,这个demo是要使用openFrame打开这个页面,使用openWin会失败,希望有大神能帮我看一下iOS为什么会闪退?




<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>视频下载</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        html, body {
            height: 100%;
            width: 100%;
        }

        #wrap {
            height: 100%;
            display: -webkit-box;
            display: -webkit-flex;
            display: flex;
            -webkit-box-orient: vertical;
            -webkit-flex-flow: column;
            flex-flow: column;
            background-color: #f8f8f8;
        }

        #header {
            position: relative;
            text-align: center;
            background-color: #f08519;
            color: #fff;
            width: 100%;
            line-height: 44px;
            font-size: 17px;
        }

        #header h1 {
            font-size: 20px;
            height: 44px;
            line-height: 44px;
            margin: 0;
            color: #fff;
        }

        #main {
            text-align: center;
            -webkit-box-flex: 1;
            -webkit-flex: 1;
            flex: 1;
            padding: 2em;
            background-color: #fff;
        }

        #footer {
            position: relative;
            height: 50px;
            line-height: 50px;
            color: #666;
            background-color: #f8f8f8;
            width: 100%;
            text-align: center;
        }

        .btn {
            margin-top: 20px;
            background-color: #f08519;
            line-height: 50px;
            border-radius: 5px;
            color: #fff;
        }

        .progress-text {
            margin-top: 20px;
            line-height: 30px;
        }

        .progress-percent {
            margin-top: 20px;
            height: 2px;
            background-color: #f08519;
        }
    </style>
</head>
<body>
<div id="wrap">
    <div id="header">测试视频播放</div>
    <div id="main">
        <div class="btn" onclick="api.closeFrame();">关闭frame</div>
        <div class="btn" onclick="download();">下载视频</div>
        <div class="progress-text" id="text" hidden>0%</div>
        <div class="progress-percent" id="percent" hidden></div>
    </div>
    <div id="footer" onclick="location.reload();">刷新页面</div>
</div>
<script src="http://cdn**.**/jquery/2.1.4/jquery.min.js"></script>
<script>
    apiready = function (){
    };
    var fileName = 'test333.mkv';
    var url = 'http://mobiledev**.**/uploads/' + fileName;
    function download(){
        api.download({
            url: url,
            savePath: 'fs://download/' + fileName,
            report: true,
            cache: true,
            allowResume: true
        }, function (downloadRet, downloadErr){
            $('#text').html(downloadRet.percent + '%').show();
            $('#percent').css('width', downloadRet.percent + '%').show();
            if (parseFloat(downloadRet.percent) == 100) {
                api.confirm({
                    msg: '下载完成,点击查看',
                    buttons: ['取消', '确定']
                }, function (confirmRet, confirmErr){
                    if (confirmRet.buttonIndex == 2) {//点击确定
                        var obj = api.require('polyVideo');
                        try {
                            obj.open({
                                rect: {
                                    x: 0,
                                    y: 0,
                                    w: api.winWidth,
                                    h: 240
                                },
                                //vid: '02d7f2dc232a2760e985d3dae7d3f936_0',
                                path: downloadRet.savePath,
                                autoPlay: true,
                                fixedOn: api.frameName,
                                fixed: false
                            }, function (ret1, err1){
                            });
                        } catch (e) {
                            alert(JSON.stringify(e))
                        }
                    }
                });
            }
        });
    }
</script>
</body>
</html>
12下一页
您需要登录后才可以回帖 登录

本版积分规则