1/* 2 * jPlayer Plugin for jQuery JavaScript Library 3 * http://www.jplayer.org 4 * 5 * Copyright (c) 2009 - 2014 Happyworm Ltd 6 * Licensed under the MIT license. 7 * http://opensource.org/licenses/MIT 8 * 9 * Author: Robert M. Hall 10 * Date: 7th August 2012 11 */ 12 13// This class was found to cause problems on OSX with Firefox and Safari where more than 8 instances of the SWF are on a page. 14 15package happyworm.jPlayer 16{ 17 import flash.net.LocalConnection; 18 import flash.events.StatusEvent; 19 import flash.system.Capabilities; 20 import flash.utils.getTimer; 21 22 public class TraceOut 23 { 24 25 private var outgoing_lc:LocalConnection = new LocalConnection (); 26 private var firstEvent:Boolean = true; 27 private var _localAIRDebug:Boolean = false; 28 29 public function TraceOut() 30 { 31 outgoing_lc.addEventListener(StatusEvent.STATUS, lcListener); 32 outgoing_lc.send("_log_output","startLogging",""); 33 } 34 35 private function lcListener(event:StatusEvent):void 36 { 37 // Must have this listener to avoid errors 38 if (event.level == "error") 39 { 40 _localAIRDebug = false; 41 } 42 else if(event.level =="status" && firstEvent==true) 43 { 44 firstEvent = false; 45 tracer("<< Successful Connection To Event Logger >>"); 46 tracer("DEBUG INFO: \n<"+Capabilities.serverString + ">\nFlash Player Version: " + Capabilities.version + "\n"); 47 _localAIRDebug = true; 48 } 49 } 50 51 public function localAIRDebug():Boolean 52 { 53 return _localAIRDebug; 54 } 55 56 public function tracer(msg:String):void 57 { 58 trace(msg); 59 var outMsg:String = "[" + getTimer() + "ms] " + msg; 60 outgoing_lc.send("_log_output","displayMsg",outMsg); 61 62 } 63 } 64} 65