fix lihat video

parent 7e5f92c2
......@@ -49,7 +49,7 @@ class LoginController extends Controller
try {
$clientbiodata = new Client();
$apiRequestbiodata = $clientbiodata->request('GET', 'https://sso.unesa.ac.id/userid/'.'muhammadjava@mhs.unesa.ac.id');
$apiRequestbiodata = $clientbiodata->request('GET', 'https://sso.unesa.ac.id/userid/'.'ranum.18066@mhs.unesa.ac.id');
$aksessso = json_decode($apiRequestbiodata->getBody()->getContents());
} catch (\Exception $apiRequestbiodata) {
$gagal_login = 'Data Tidak Ditemukan';
......
......@@ -108,12 +108,12 @@
</td>
<td>
<button data-bs-toggle="modal" data-bs-target="{{ '#lihat'.$item->proposal_id }}" href="{{ URL::to('mahasiswa/kelompok-new', encrypt($item->proposal_id)) }}" class="btn btn-info btn-sm">Lihat</button>
@if(is_null($item->status) || $item->status == '2')
<a href="{{ URL::to('mahasiswa/proposal/'.encrypt($item->proposal_id).'/edit') }}" class="btn btn-warning btn-sm">Revisi</a>
<a onclick="hapus('{{ encrypt($item->proposal_id) }}', 'row-{{ $token }}')" class="btn btn-danger btn-sm">Hapus</a>
@endif
<div id="{{ 'lihat'.$item->proposal_id }}" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="lihatLabel" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered">
......@@ -172,7 +172,7 @@
<strong>Informasi!</strong> File tidak ditemukan.
</div>
@endif
</td>
</td>
</tr>
</table>
</div>
......@@ -239,71 +239,73 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.min.js"></script>
<!-- Kode JavaScript untuk Magnific Popup -->
<script>
$(document).ready(function() {
// Event handler untuk tombol "Lihat Video" dengan ID preview-video
$('#preview-video').on('click', function() {
var videoUrl = $(this).data('video');
@if (count($proposal) > 0)
<script>
$(document).ready(function() {
// Event handler untuk tombol "Lihat Video" dengan ID preview-video
$('#preview-video').on('click', function() {
var videoUrl = $(this).data('video');
if (videoUrl) {
// Buka video dalam Magnific Popup
$.magnificPopup.open({
items: {
src: videoUrl
},
type: 'iframe',
iframe: {
markup: '<div class="mfp-iframe-scaler">'+
'<div class="mfp-close"></div>'+
'<iframe class="mfp-iframe" frameborder="0" allowfullscreen allow="autoplay"></iframe>'+
'</div>'
},
callbacks: {
open: function() {
// Sembunyikan modal lama saat Magnific Popup dibuka
$('#{{ 'lihat'.$item->proposal_id }}').modal('hide');
// Mulai autoplay video setelah Magnific Popup dibuka
var iframe = this.content.find('iframe');
if (iframe.length > 0) {
var videoSrc = iframe.attr('src');
iframe.attr('src', videoSrc + '&autoplay=1'); // Tambahkan autoplay=1 ke URL video
}
if (videoUrl) {
// Buka video dalam Magnific Popup
$.magnificPopup.open({
items: {
src: videoUrl
},
close: function() {
// Tampilkan kembali modal lama setelah Magnific Popup ditutup
$('#{{ 'lihat'.$item->proposal_id }}').modal('show');
// Hentikan autoplay video saat Magnific Popup ditutup
var iframe = this.content.find('iframe');
if (iframe.length > 0) {
var videoSrc = iframe.attr('src');
iframe.attr('src', videoSrc.replace('&autoplay=1', '')); // Hapus autoplay=1 dari URL video
type: 'iframe',
iframe: {
markup: '<div class="mfp-iframe-scaler">'+
'<div class="mfp-close"></div>'+
'<iframe class="mfp-iframe" frameborder="0" allowfullscreen allow="autoplay"></iframe>'+
'</div>'
},
callbacks: {
open: function() {
// Sembunyikan modal lama saat Magnific Popup dibuka
$('#{{ 'lihat'.$item->proposal_id }}').modal('hide');
// Mulai autoplay video setelah Magnific Popup dibuka
var iframe = this.content.find('iframe');
if (iframe.length > 0) {
var videoSrc = iframe.attr('src');
iframe.attr('src', videoSrc + '&autoplay=1'); // Tambahkan autoplay=1 ke URL video
}
},
close: function() {
// Tampilkan kembali modal lama setelah Magnific Popup ditutup
$('#{{ 'lihat'.$item->proposal_id }}').modal('show');
// Hentikan autoplay video saat Magnific Popup ditutup
var iframe = this.content.find('iframe');
if (iframe.length > 0) {
var videoSrc = iframe.attr('src');
iframe.attr('src', videoSrc.replace('&autoplay=1', '')); // Hapus autoplay=1 dari URL video
}
}
}
}
});
} else {
// Tampilkan pesan kesalahan jika URL video tidak valid
console.error('URL video tidak valid:', videoUrl);
}
});
} else {
// Tampilkan pesan kesalahan jika URL video tidak valid
console.error('URL video tidak valid:', videoUrl);
}
});
});
});
</script>
</script>
@endif
{{-- <script>
document.addEventListener("DOMContentLoaded", function() {
var openModalBtn = document.getElementById("openModalBtn");
var closeModalBtn = document.getElementById("closeModalBtn");
var modal = document.getElementById("myModal");
openModalBtn.addEventListener("click", function() {
modal.style.display = "block";
// Mengambil URL dari objek $item
var proposalUrl = "{{ $item->rProposalUrl->url }}";
// Load konten eksternal ke dalam div modalContent
var xhr = new XMLHttpRequest();
xhr.open("GET", proposalUrl, true);
......@@ -314,11 +316,11 @@ $(document).ready(function() {
};
xhr.send();
});
closeModalBtn.addEventListener("click", function() {
modal.style.display = "none";
});
window.addEventListener("click", function(event) {
if (event.target == modal) {
modal.style.display = "none";
......
......@@ -51,10 +51,10 @@
<table class="table table-striped">
<thead>
<tr style="text-align: center">
<th style="width: 70%">Komponen</th>
<th style="width: 10%">Bobot</th>
<th style="width: 10%">Skor</th>
<th>Komponen</th>
{{-- <th style="width: 10%">Bobot</th> --}}
<th style="width: 10%">Nilai</th>
{{-- <th style="width: 10%">Nilai</th> --}}
</tr>
</thead>
<tbody>
......@@ -75,7 +75,7 @@
<input type="hidden" name="jenis_penilaian_id[]" value="{{ $val->jenis_penilaian_monev_id }}">
<span>{{ $val->nama }}</span>
</td>
<td><span id="varBobot-{{ $val->jenis_penilaian_monev_id }}">{{ $val->bobot }}</span></td>
{{-- <td><span id="varBobot-{{ $val->jenis_penilaian_monev_id }}">{{ $val->bobot }}</span></td> --}}
<td>
<select name="skor[]" class="hitung_skor" data-id="{{ $val->jenis_penilaian_monev_id }}">
<option value="1" @if($skor == '1') selected="selected" @endif>1</option>
......@@ -86,7 +86,7 @@
<option value="7" @if($skor == '7') selected="selected" @endif>7</option>
</select>
</td>
<td><span id='varNilai-{{ $val->jenis_penilaian_monev_id }}' class="clsNilai">{{ $nilai }}</span></td>
{{-- <td><span id='varNilai-{{ $val->jenis_penilaian_monev_id }}' class="clsNilai">{{ $nilai }}</span></td> --}}
</tr>
@php
$total += $nilai;
......@@ -149,8 +149,8 @@
function sum(){
var sum = 0;
$('.clsNilai').each(function () {
sum += Number($(this).text());
$('.hitung_skor').each(function () {
sum += Number($(this).val());
});
$('#varTotalNilai').text(sum);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment