video_call.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup UnaCoreSamples Samples
  7. * @{
  8. */
  9. /**
  10. * @page samples
  11. * @section test Test
  12. */
  13. $aPathInfo = pathinfo(__FILE__);
  14. require_once ($aPathInfo['dirname'] . '/../inc/header.inc.php');
  15. require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
  16. $oTemplate = BxDolTemplate::getInstance();
  17. $oTemplate->setPageNameIndex (BX_PAGE_DEFAULT);
  18. $oTemplate->setPageHeader ('Video Call');
  19. $oTemplate->setPageContent ('page_main_code', PageCompMainCode());
  20. $oTemplate->getPageCode();
  21. /**
  22. * page code function
  23. */
  24. function PageCompMainCode()
  25. {
  26. ob_start();
  27. ?>
  28. <!-- control jitsi from js -->
  29. <div class="bx-clearfix">
  30. <a href="javascript:void(0);" class="bx-btn bx-def-margin-right" onclick="bx_mobile_apps_post_message({video_call_start:{uri:'aa2dd3'}})">VideoCall</a>
  31. <a href="javascript:void(0);" class="bx-btn bx-def-margin-right" onclick="bx_mobile_apps_post_message({video_call_start:{uri:'aa2dd3', audio:true}})">AudioCall</a>
  32. <a href="javascript:void(0);" class="bx-btn" onclick="bx_mobile_apps_post_message({video_call_stop:true})">EndCall</a>
  33. </div>
  34. <!-- receive events from jitsi -->
  35. <script>
  36. if (typeof window.glBxVideoCallWillJoin === 'undefined')
  37. window.glBxVideoCallWillJoin = [];
  38. window.glBxVideoCallWillJoin.push(function (e) {
  39. $('#video_log').append('<div>VideoCallWillJoin</div>');
  40. });
  41. if (typeof window.glBxVideoCallJoined === 'undefined')
  42. window.glBxVideoCallJoined = [];
  43. window.glBxVideoCallJoined.push(function (e) {
  44. $('#video_log').append('<div>VideoCallJoined</div>');
  45. });
  46. if (typeof window.glBxVideoCallTerminated === 'undefined')
  47. window.glBxVideoCallTerminated = [];
  48. window.glBxVideoCallTerminated.push(function (e) {
  49. $('#video_log').append('<div>VideoCallTerminated</div>');
  50. });
  51. </script>
  52. <div id="video_log" class="bx-def-border bx-def-margin-top" style="min-height:100px; overflow:auto;"></div>
  53. <?php
  54. return DesignBoxContent("Video Call", ob_get_clean(), BX_DB_PADDING_DEF);
  55. }
  56. /** @} */