Flash更新12打破了我的录像机

时间:2014-03-04 20:49:26

标签: actionscript-3 flash flex video flex4.6

当flash将12.0.0.70版本推送到Chrome时,它会损坏我的录像机。

根据patch notes here,有一件事情发生了变化,可能会破坏我基于闪光灯的刻录机

  

[3689061] [视频]解决了Flash Player中注入的问题   11.9.900.170如果缓冲区在播放RTMP流时被清空,则导致视频缓冲区不再被填充

当停止流并将视频保存到Adobe Media Server时,我的刻录机会中断。

我尝试使用12.0.0.70闪存调试器进行调试,但是当我使用调试器时它不会崩溃。只有在使用非调试版Chrome版本时才会崩溃。

我无法调试它并从我的swf中获取任何有用的信息,除了向console.log进行一系列外部调用以查看它失败的地方。

如果有人在基于闪存的媒体服务器连接的网络摄像头上遇到类似的问题,并且可以猜测可能解决我的问题,我将不胜感激。

我正在使用Flex 4.6.0构建此swf


这是停止录像机的功能。

public function doStop():void{
            if(status=="paused"){
                doResume();
            }

            rectColor.color=0x000000;
            rectColor.alpha=1;

            var timer:Timer=new Timer(1 * 10);
            timer.addEventListener(TimerEvent.TIMER,function(e:TimerEvent):void{
                timer.stop();
                timer.reset();
                myns.close();
                myTimer.stop();
                if(!thumbBeginning){
                    if(status=="recording"){
                        takeScreenShot();
                    }
                }else{
                    if(status=="recording"){
                        recordingTime = formatTime(realTime);
                        recordingLength = myTimer.currentCount;
                        if(!redoFlag){
                            ExternalInterface.call("CTRecorder.stopOk");
                            myTime.text = formatTime(0);
                            VD1.attachCamera(myCam);
                            setState("ready");
                            status = "stopped, ready"
                            playbackTimer.reset();
                            msg(recordingTime);
                            recording=false;
                            pauseTime=0;
                        }else{
                            pauseTime=0;
                            myTime.text = formatTime(0);
                            VD1.attachCamera(myCam);
                            playbackTimer.reset();
                            msg(recordingTime);
                            recording=false;

                        }
                    }


                    if(shutterGroup.visible){
                        toggleShutter();
                    }

                    myTimer.stop();

                    myTimer.reset();

                    if(redoFlag){
                        doRecord();
                        redoFlag=false;
                        trace("redoFlag turned off");
                    }
                }
                rectColor.alpha=.5;
            });
            timer.start();
        }

1 个答案:

答案 0 :(得分:2)

这不是一个真正的答案,但是评论的时间太长了。

“我无法调试它” - 它只在发布版本中中断?发布版本是pepper插件(即Chrome的Flash版本),调试是NPAPI插件(即Adobe的版本)吗?

ExternalInterface.call("CTRecorder.stopOk");电话可能会导致它被打破。您是在本地还是远程测试?如果是本地的,那么您可能会遇到此错误:https://code.google.com/p/chromium/issues/detail?id=137734其中Flash< - >由于在PPAPI闪存中忽略了可信位置,因此JS通信中断。在任何情况下,尝试安装版本的NPAPI版本的Flash,看看它是否仍然崩溃(你可以通过访问chrome:// plugins /来验证哪一个正在运行)

为了帮助调试发布版本,您需要一个日志记录系统 - 而不是拨打trace()电话,而是调用自定义log()函数,以及trace() ing,将消息存储在某个地方,就像在数组中一样。然后,在您的SWF中,当您点击某个键时,在屏幕上显示TextField,并使用您的log()消息填充它。这样,您就可以在发布模式下看到trace()语句。

此外,不要忘记收听任何相对错误事件和抛出异常 - ExternalInterface.call()会抛出ErrorSecurityError。您还可以设置marshallExceptions属性,该属性会将ActionScript异常传递给浏览器,并将JavaScript异常传递给播放器:http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html#marshallExceptions

最后,在主类上添加一个UncaughtErrorEvent.UNCAUGHT_ERROR事件的监听器,它将捕获任何未被捕获的抛出错误(有趣的是),这至少意味着你的应用程序不会崩溃:

mainClass.loaderInfo.uncaughtErrorEvents.addEventListener( UncaughtErrorEvent.UNCAUGHT_ERROR, this._onUncaughtErrorEvent );
private function _onUncaughtErrorEvent( e:UncaughtErrorEvent ):void
{
    var message:String      = null;
    var stackTrace:String   = null;

    // get the message
    if ( e.error is Error )
    {
        message = ( e.error as Error ).message;
        try { stackTrace = ( e.error as Error ).getStackTrace(); }
        catch ( error:Error ) { stackTrace = "No stack trace"; }
    }
    else if ( e.error is ErrorEvent )
        message = ( e.error as ErrorEvent ).text;
    else
        message = e.error.toString();

    // show an alert
    trace( "An uncaught exception has occurred: " + e.errorID + ": " + e.type + ": " + message + ", stack:\n" + stackTrace );
    e.preventDefault();
}