IMMREX7
@extends('students.student_layout')
@section('content')
<div class="row clearfix">
<button class="btn btn-raised btn-danger waves-effect btn-round js-sweetalert" onclick="endCall()">End Live Session</button>
<div class="card"><p style="padding:20px; font-size: 20px; font-weight: bold;color:red;">Time Remaining: <span id="timer" ><span></p></div>
<div class="card" id="meet">
</div>
</div>
@stop
@section('script')
<script src='https://meet.jit.si/external_api.js'></script>
<script type="text/javascript">
const domain = 'meet.jit.si';
const options = {
roomName: '{{$key}}',
width: 1200,
height: 700,
userInfo: {
email: '{{$student->ecNo}}',
displayName: '{{$student->firstName}}'
},
parentNode: document.querySelector('#meet'),
configOverwrite: {
enableWelcomePage: false,
liveStreamingEnabled: false,
enableClosePage : false,
disableRemoteMute: true,
remoteVideoMenu:{
disableKick: true
}
},
interfaceConfigOverwrite: {
SHOW_POWERED_BY: false,
TOOLBAR_BUTTONS: [
'microphone', 'camera', 'closedcaptions', 'raisedhand', 'fullscreen'
],
VERTICAL_FILMSTRIP: false
}
};
const api = new JitsiMeetExternalAPI(domain, options);
api.executeCommand('startRecording', {
mode : "stream",
youtubeStreamKey: "{{$key}}",
youtubeBroadcastID : ""
});
api.executeCommand('subject', 'Live Class');
function endCall(){
api.dispose();
window.location.href = "{{url('/student/videoconf')}}";
}
</script>
<script>
/*document.getElementById('meet').onload= function() {
document.getElementsByClassName('watermark').style.visibility ="hidden"
}; */
</script>
<script>
// Set the date we're counting down to
<?php $date = \Carbon\Carbon::parse($liveClass->description)->format('d-m-Y');$time = \Carbon\Carbon::parse($liveClass->description)->format('H:i:s'); ?>
var countDownDate = <?php
echo strtotime("$date $time" ) ?> * 1000;
// Update the count down every 1 second
var x = setInterval(function() {
// Get today's date and time
var now = new Date().getTime();
// Find the distance between now and the count down date
var distance = countDownDate - now;
// Time calculations for days, hours, minutes and seconds
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Display the result in the element with id="demo"
document.getElementById("timer").innerHTML = hours + "h "
+ minutes + "m " + seconds + "s ";
// If the count down is finished, write some text
if (distance < 0) {
clearInterval(x);
window.location.href = "https://www.youtube.com/embed/{{$liveClass->videoKey}}";
// document.getElementById("timer").innerHTML = "EXPIRED";
}
}, 1000);
</script>
@stop
Copyright © 2021 -