ajax.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * This script initiates a video conference session, calling the BigBlueButton API.
  4. *
  5. * @package chamilo.plugin.bigbluebutton
  6. */
  7. $course_plugin = 'bbb'; //needed in order to load the plugin lang variables
  8. $cidReset = true;
  9. require_once __DIR__.'/../../main/inc/global.inc.php';
  10. $action = isset($_REQUEST['a']) ? $_REQUEST['a'] : null;
  11. $meetingId = isset($_REQUEST['meeting']) ? intval($_REQUEST['meeting']) : 0;
  12. $bbb = new bbb('', '');
  13. switch ($action) {
  14. case 'check_m4v':
  15. if (!api_is_platform_admin()) {
  16. api_not_allowed();
  17. exit;
  18. }
  19. if (!$meetingId) {
  20. exit;
  21. }
  22. if ($bbb->checkDirectMeetingVideoUrl($meetingId)) {
  23. $meetingInfo = Database::select(
  24. '*',
  25. 'plugin_bbb_meeting',
  26. ['where' => ['id = ?' => intval($meetingId)]],
  27. 'first'
  28. );
  29. $url = $meetingInfo['video_url'].'/capture.m4v';
  30. $link = Display::url(
  31. Display::return_icon('save.png', get_lang('Download file')),
  32. $meetingInfo['video_url'].'/capture.m4v',
  33. ['target' => '_blank']
  34. );
  35. header('Content-Type: application/json');
  36. echo json_encode(['url' => $url, 'link' => $link]);
  37. }
  38. break;
  39. }