ajax.php 1.3 KB

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