示例#1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $room = Room::findOrFail($id);
     if (!roomController::checkAccess($room)) {
         throw new Exception('Unauthorized');
     }
     $participants = $room->participants()->get();
     $recordings = recordingsController::get($room);
     return view('room.show', ['room' => $room, 'participants' => $participants, 'recordings' => $recordings, 'owner' => $room->belongs, 'check_owner' => roomController::checkOwner($room)]);
 }
示例#2
0
 public function join($id)
 {
     $room = Room::findOrFail($id);
     $access = roomController::checkAccess($room);
     if (!$access) {
         throw new Exception('Unauthorized');
     } else {
         if ($access == 1) {
             $pass = $room->mod_pass;
         } else {
             $pass = $room->att_pass;
         }
     }
     //check if meeting running and create if needed
     $bbb_id = bbbController::running($room);
     if (!$bbb_id) {
         $bbb_id = bbbController::create($room);
     }
     $user = Auth::user();
     //join meeting
     $bbb = new BigBlueButton($bbb_id);
     $params = array('meetingId' => $room->bbb_meeting_id, 'username' => $user->mail, 'userId' => '', 'webVoiceConf' => '', 'password' => $pass);
     try {
         $result = $bbb->getJoinMeetingURL($params);
     } catch (Exception $e) {
         throw new Exception($e->getMessage() . "\n");
     }
     return redirect($result);
 }