Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Uncaught TypeError: Object #<HTMLEmbedElement> has no method 'controlAudioVideoSharing' teacher.html:63
- Uncaught TypeError: Object #<HTMLEmbedElement> has no method 'controlStudentsView' teacher.html:71
- Uncaught TypeError: Object #<HTMLEmbedElement> has no method 'viewWebCam' teacher.html:86
- Uncaught TypeError: Object #<HTMLEmbedElement> has no method 'controlWebcam'
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Test Audio/video</title>
- <link rel="stylesheet" type="text/css" href="jqcontextmenu.css" />
- <script type="text/javascript" src="jquery-1.8.3.min.js"></script>
- <script type="text/javascript" src="jqcontextmenu.js"></script>
- <script type="text/javascript">
- //define global variables
- var userId = 1;
- var userType = 'teacher';
- var sessionId = 100;
- // Internet Explorer and Mozilla-based browsers refer to the Flash application
- // object differently.
- // This function returns the appropriate reference, depending on the browser.
- function getMyApp(appName) {
- if (navigator.appName.indexOf ("Microsoft") !=-1) {
- return window[appName];
- } else {
- return document[appName];
- }
- }
- /** control webcam */
- function webcamStatus(action)
- {
- /*
- if(action == "start")
- document.getElementById("swfContainer").style.display = '';
- else
- document.getElementById("swfContainer").style.display = 'none';
- */
- //call flex method
- getMyApp("videoSwf").controlWebcam(action);
- }
- /** control mic */
- function micStatus(action)
- {
- /*
- if(action == "start")
- document.getElementById("swfContainer").style.display = 'none';
- */
- //call flex method
- getMyApp("videoSwf").controlMic(action);
- }
- /** control audio/video sharing */
- function shareStatus(action)
- {
- //call flex method
- getMyApp("videoSwf").controlAudioVideoSharing(action);
- }
- /** control students permission */
- function AllowStudents(action)
- {
- //call flex method
- getMyApp("videoSwf").controlStudentsView(action);
- }
- /** view cam */
- function viewCam(action,uId,uType)
- {
- /*
- if(action == "start")
- document.getElementById("swfContainer").style.display = '';
- else
- document.getElementById("swfContainer").style.display = 'none';
- */
- //call flex method
- getMyApp("videoSwf").viewWebCam(action,uId,uType);
- }
- /** play audio */
- function playAudio(action,uId,uType,uType)
- {
- /*
- if(action == "start")
- document.getElementById("swfContainer").style.display = 'none';
- */
- //call flex method
- getMyApp("videoSwf").playAudio(action,uId);
- }
- /*
- ** check right click menu
- */
- function showRightMenu(uId,uType)
- {
- //create dynamic context menu
- var strHTML = "";
- if(uId == userId)
- {
- strHTML += "<li><a href='javascript:webcamStatus("start")'>Start Webcam</a></li>";
- strHTML += "<li><a href='javascript:webcamStatus("stop")'>Stop Webcam</a></li>";
- strHTML += "<li><a href='javascript:micStatus("start")'>Start Mic</a></li>";
- strHTML += "<li><a href='javascript:micStatus("stop")'>Stop Mic</a></li>";
- strHTML += "<li><a href='javascript:shareStatus("start")'>Share Video/Audio</a></li>";
- strHTML += "<li><a href='javascript:shareStatus("stop")'>UnShare Video/Audio</a></li>";
- //check for teacher
- if(userType == "teacher")
- {
- strHTML += "<li><a href='javascript:AllowStudents("start")'>Allow Students To View Each Other</a></li>";
- strHTML += "<li><a href='javascript:AllowStudents("stop")'>Deny Students To View Each Other</a></li>";
- }
- }
- else
- {
- strHTML += "<li><a href='javascript:viewCam("start","+uId+",""+uType+"")'>View Cam</a></li>";
- strHTML += "<li><a href='javascript:viewCam("stop","+uId+",""+uType+"")'>Hide Cam</a></li>";
- strHTML += "<li><a href='javascript:playAudio("start","+uId+",""+uType+"")'>Play Audio</a></li>";
- strHTML += "<li><a href='javascript:playAudio("stop","+uId+",""+uType+"")'>Stop Audio</a></li>";
- }
- //add html to context menu
- document.getElementById("contextmenu").innerHTML = strHTML;
- }
- //on document load
- jQuery(document).ready(function($){
- $('a.onlineUser').addcontextmenu('contextmenu') //apply context menu to all online users links
- })
- </script>
- </head>
- <body>
- <!-- Embed swf file -->
- <div id="swfContainer" style="clear:left;">
- <object id='videoSwf' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width="320" height="240">
- <param name='src' value='index.swf'/>
- <param name="quality" value="high" />
- <param name="bgcolor" value="#ffffff" />
- <param name="allowScriptAccess" value="all" />
- <param name="wmode" value="transparent" />
- <param name="allowFullScreen" value="true" />
- <param name="flashVars" value="userId=1&userType=teacher&sessionId=100" />
- <embed name='videoSwf' src='VideoSamplClient.swf' quality='high' bgcolor = '#ffffff' allowScriptAccess= 'all' wmode= 'transparent' allowFullScreen='true' width="320" height="240" flashVars='userId=1&userType=teacher&sessionId=100'/>
- </object>
- </div>
- <!-- online users list -->
- <div style="clear:left"><b>Online Users</b></div>
- <div id="onlineUsersList" align="left" style="clear:left; width:100px; height:150px; border:1px solid #666; padding-left:10px;" >
- <div><a href="#" id="user1" class="onlineUser" style="text-decoration:none" oncontextmenu="showRightMenu(1,'teacher');return false;">Teacher</a></div>
- <div><a href="#" id="user2" class="onlineUser" style="text-decoration:none" oncontextmenu="showRightMenu(2,'student');return false;">Student 1</a></div>
- <div><a href="#" id="user3" class="onlineUser" style="text-decoration:none" oncontextmenu="showRightMenu(3,'student');return false;">Student 2</a></div>
- </div>
- <!-- context menu -->
- <ul id="contextmenu" class="jqcontextmenu"></ul>
- </body>
- </html>
- //callback javascript functions
- ExternalInterface.addCallback("controlWebcam",webcamController);
- ExternalInterface.addCallback("controlMic",micController);
- ExternalInterface.addCallback("controlAudioVideoSharing",shareAudioVideo);
- ExternalInterface.addCallback("controlStudentsView",studentsPermission);
- ExternalInterface.addCallback("viewWebCam",controlAudioVideoPlaying);
- ExternalInterface.addCallback("playAudio",controlAudioVideoPlaying);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement