public static function getInstance($id, $key) { if (!self::$_instance instanceof self) { self::$_instance = new self($id, $key); } return self::$_instance; }
<?php include "./ctrtc.php"; $appaccount = $_GET["user"]; $terminalType = $_GET["terminal"]; if (empty($appaccount)) { $appaccount = time(); } if (empty($terminalType)) { $terminalType = "Browser"; } $appid = "changeit"; $appkey = "changeit"; //$appid = "70038"; //$appkey = "MTQxMDkyMzU1NTI4Ng=="; $ctrtc = Ctrtc::getInstance($appid, $appkey); $token = $ctrtc->generateToken(Ctrtc::ACC_INNER, $appaccount, $terminalType); ?> <!DOCTYPE html> <html> <head> <title>CTRTC JSSDK DEMO</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script src="ctrtc.min.js" type="text/javascript"></script><!-- 引用jssdk rtc.js --> <script src="jquery-1.6.1.min.js" type="text/javascript"></script> <style type="text/css"> .panelLocal{border:1px solid #F00;width:220px } .panelRemote{border:1px solid #336666;width:640px} </style> </head> <body>