Advertisement
Guest User

Untitled

a guest
Dec 27th, 2012
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.95 KB | None | 0 0
  1. Uncaught TypeError: Object #<HTMLEmbedElement> has no method 'controlAudioVideoSharing' teacher.html:63
  2. Uncaught TypeError: Object #<HTMLEmbedElement> has no method 'controlStudentsView' teacher.html:71
  3. Uncaught TypeError: Object #<HTMLEmbedElement> has no method 'viewWebCam' teacher.html:86
  4. Uncaught TypeError: Object #<HTMLEmbedElement> has no method 'controlWebcam'
  5.  
  6. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  7. <html xmlns="http://www.w3.org/1999/xhtml">
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  10. <title>Test Audio/video</title>
  11. <link rel="stylesheet" type="text/css" href="jqcontextmenu.css" />
  12. <script type="text/javascript" src="jquery-1.8.3.min.js"></script>
  13. <script type="text/javascript" src="jqcontextmenu.js"></script>
  14.  
  15. <script type="text/javascript">
  16.  
  17. //define global variables
  18. var userId = 1;
  19. var userType = 'teacher';
  20. var sessionId = 100;
  21.  
  22. // Internet Explorer and Mozilla-based browsers refer to the Flash application
  23. // object differently.
  24. // This function returns the appropriate reference, depending on the browser.
  25. function getMyApp(appName) {
  26. if (navigator.appName.indexOf ("Microsoft") !=-1) {
  27. return window[appName];
  28. } else {
  29. return document[appName];
  30. }
  31. }
  32.  
  33.  
  34.  
  35. /** control webcam */
  36. function webcamStatus(action)
  37. {
  38. /*
  39. if(action == "start")
  40. document.getElementById("swfContainer").style.display = '';
  41. else
  42. document.getElementById("swfContainer").style.display = 'none';
  43. */
  44.  
  45.  
  46. //call flex method
  47. getMyApp("videoSwf").controlWebcam(action);
  48. }
  49.  
  50.  
  51. /** control mic */
  52. function micStatus(action)
  53. {
  54. /*
  55. if(action == "start")
  56. document.getElementById("swfContainer").style.display = 'none';
  57. */
  58.  
  59.  
  60. //call flex method
  61. getMyApp("videoSwf").controlMic(action);
  62. }
  63.  
  64. /** control audio/video sharing */
  65. function shareStatus(action)
  66. {
  67. //call flex method
  68. getMyApp("videoSwf").controlAudioVideoSharing(action);
  69. }
  70.  
  71. /** control students permission */
  72. function AllowStudents(action)
  73. {
  74.  
  75. //call flex method
  76. getMyApp("videoSwf").controlStudentsView(action);
  77. }
  78.  
  79. /** view cam */
  80. function viewCam(action,uId,uType)
  81. {
  82. /*
  83. if(action == "start")
  84. document.getElementById("swfContainer").style.display = '';
  85. else
  86. document.getElementById("swfContainer").style.display = 'none';
  87. */
  88.  
  89.  
  90. //call flex method
  91. getMyApp("videoSwf").viewWebCam(action,uId,uType);
  92. }
  93.  
  94. /** play audio */
  95. function playAudio(action,uId,uType,uType)
  96. {
  97.  
  98. /*
  99. if(action == "start")
  100. document.getElementById("swfContainer").style.display = 'none';
  101. */
  102.  
  103. //call flex method
  104. getMyApp("videoSwf").playAudio(action,uId);
  105. }
  106.  
  107.  
  108.  
  109.  
  110. /*
  111. ** check right click menu
  112. */
  113. function showRightMenu(uId,uType)
  114. {
  115. //create dynamic context menu
  116. var strHTML = "";
  117.  
  118. if(uId == userId)
  119. {
  120. strHTML += "<li><a href='javascript:webcamStatus("start")'>Start Webcam</a></li>";
  121. strHTML += "<li><a href='javascript:webcamStatus("stop")'>Stop Webcam</a></li>";
  122. strHTML += "<li><a href='javascript:micStatus("start")'>Start Mic</a></li>";
  123. strHTML += "<li><a href='javascript:micStatus("stop")'>Stop Mic</a></li>";
  124. strHTML += "<li><a href='javascript:shareStatus("start")'>Share Video/Audio</a></li>";
  125. strHTML += "<li><a href='javascript:shareStatus("stop")'>UnShare Video/Audio</a></li>";
  126.  
  127. //check for teacher
  128. if(userType == "teacher")
  129. {
  130. strHTML += "<li><a href='javascript:AllowStudents("start")'>Allow Students To View Each Other</a></li>";
  131. strHTML += "<li><a href='javascript:AllowStudents("stop")'>Deny Students To View Each Other</a></li>";
  132. }
  133.  
  134.  
  135. }
  136. else
  137. {
  138. strHTML += "<li><a href='javascript:viewCam("start","+uId+",""+uType+"")'>View Cam</a></li>";
  139. strHTML += "<li><a href='javascript:viewCam("stop","+uId+",""+uType+"")'>Hide Cam</a></li>";
  140. strHTML += "<li><a href='javascript:playAudio("start","+uId+",""+uType+"")'>Play Audio</a></li>";
  141. strHTML += "<li><a href='javascript:playAudio("stop","+uId+",""+uType+"")'>Stop Audio</a></li>";
  142. }
  143.  
  144.  
  145.  
  146. //add html to context menu
  147. document.getElementById("contextmenu").innerHTML = strHTML;
  148.  
  149. }
  150.  
  151. //on document load
  152. jQuery(document).ready(function($){
  153. $('a.onlineUser').addcontextmenu('contextmenu') //apply context menu to all online users links
  154. })
  155.  
  156.  
  157.  
  158.  
  159. </script>
  160.  
  161. </head>
  162.  
  163. <body>
  164.  
  165. <!-- Embed swf file -->
  166. <div id="swfContainer" style="clear:left;">
  167. <object id='videoSwf' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width="320" height="240">
  168. <param name='src' value='index.swf'/>
  169. <param name="quality" value="high" />
  170. <param name="bgcolor" value="#ffffff" />
  171. <param name="allowScriptAccess" value="all" />
  172. <param name="wmode" value="transparent" />
  173. <param name="allowFullScreen" value="true" />
  174. <param name="flashVars" value="userId=1&userType=teacher&sessionId=100" />
  175. <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'/>
  176. </object>
  177.  
  178. </div>
  179.  
  180. <!-- online users list -->
  181. <div style="clear:left"><b>Online Users</b></div>
  182. <div id="onlineUsersList" align="left" style="clear:left; width:100px; height:150px; border:1px solid #666; padding-left:10px;" >
  183. <div><a href="#" id="user1" class="onlineUser" style="text-decoration:none" oncontextmenu="showRightMenu(1,'teacher');return false;">Teacher</a></div>
  184. <div><a href="#" id="user2" class="onlineUser" style="text-decoration:none" oncontextmenu="showRightMenu(2,'student');return false;">Student 1</a></div>
  185. <div><a href="#" id="user3" class="onlineUser" style="text-decoration:none" oncontextmenu="showRightMenu(3,'student');return false;">Student 2</a></div>
  186.  
  187. </div>
  188.  
  189. <!-- context menu -->
  190. <ul id="contextmenu" class="jqcontextmenu"></ul>
  191.  
  192.  
  193. </body>
  194. </html>
  195.  
  196. //callback javascript functions
  197. ExternalInterface.addCallback("controlWebcam",webcamController);
  198. ExternalInterface.addCallback("controlMic",micController);
  199. ExternalInterface.addCallback("controlAudioVideoSharing",shareAudioVideo);
  200. ExternalInterface.addCallback("controlStudentsView",studentsPermission);
  201. ExternalInterface.addCallback("viewWebCam",controlAudioVideoPlaying);
  202. ExternalInterface.addCallback("playAudio",controlAudioVideoPlaying);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement