���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/video/ |
<?php if(!isset($_COOKIE['cookie_logged']) or $_COOKIE['cookie_logged']!=1){ header('Location: /login.php'); } define('ROOT_PATH', dirname(__FILE__) . '/'); require "configs.php"; require "lib/class_info.php"; global $INFO; $CORE = new info(); require "lib/class_functions.php"; $func = new FUNC; $CORE->input = $func->get_input(); require "lib/class_display.php"; $print = new display(); require "lib/class_db.php"; $DB = new db_driver; $DB->connect($INFO); require "includes/functions.php"; $video_id = $CORE->input['video_id']??0; $r = $DB->fetch_row($DB->query("SELECT * FROM tb_video WHERE video_id = ".$video_id." ")); $list = $r['video_link'].'|'.$r['epi_name']; if(isset($CORE->input['type']) and $CORE->input['type']=='delete_subtitle'){ $video_id = $CORE->input['id']??''; $row_check = $DB->fetch_row($DB->query("SELECT * FROM tb_video WHERE video_id = ".$video_id." LIMIT 1")); unlink($row_check['subtitle']); $arr_update_vtt = array('subtitle'=>''); $DB->do_update('tb_video',$arr_update_vtt," WHERE video_id='$video_id' "); close_popup('Đã xóa!'); } if(isset($CORE->input['submitbt'])){ $video_id = $CORE->input['video_id']??''; $row_check = $DB->fetch_row($DB->query("SELECT * FROM tb_video WHERE video_id = ".$video_id." LIMIT 1")); $f = $CORE->input['f']; $arr_update = array('video_name'=>$f['video_name'],'epi_name'=>$f['epi_name']); $DB->do_update('tb_video',$arr_update," WHERE video_id='$video_id' "); if(isset($_FILES['subtitle']) and $_FILES['subtitle']['tmp_name']!=''){ $ext = $func->get_file_extension($_FILES['subtitle']['name']); if($ext!='vtt' and $ext!='srt'){ close_popup('Subtitle là .vtt hoặc .srt file'); } $arr_file = explode('/',$row_check['video_link']); $folder = 'subtitle/'.$arr_file[2].'/'.$arr_file[3].'/'.$arr_file[4]; if (!is_dir($folder)) { mkdir($folder, 0755,true); } $file_name = $folder.'/'.basename($row_check['video_link']).'.vtt'; @unlink($row_check['subtitle']); if($ext=='srt'){ $root_path = $INFO['root_path']; $inputSrt = $_FILES['subtitle']['tmp_name']; $outputVtt = $root_path.'/'.$file_name; $command = "ffmpeg -i $inputSrt $outputVtt"; $out4 = shell_exec($command); if($out4!==false){ //unlink($row_check['subtitle']); $arr_update_vtt = array('subtitle' => $file_name); $DB->do_update('tb_video', $arr_update_vtt, " WHERE video_id='$video_id' "); } }else { if (move_uploaded_file($_FILES['subtitle']['tmp_name'], $file_name)) { //unlink($row_check['subtitle']); $arr_update_vtt = array('subtitle' => $file_name); $DB->do_update('tb_video', $arr_update_vtt, " WHERE video_id='$video_id' "); } } } close_popup('Updated!'); } ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title><?php echo $r['video_name'];?></title> <!-- Bootstrap core CSS --> <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous"> <link rel="stylesheet" href="layout/font6/css/all.css" /> <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css" rel="stylesheet" /> <style> .select2-container .select2-selection--single{ height: auto;!important; } </style> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/plyr/3.7.8/plyr.css" integrity="sha512-yexU9hwne3MaLL2PG+YJDhaySS9NWcj6z7MvUDSoMhwNghPgXgcvYgVhfj4FMYpPh1Of7bt8/RK5A0rQ9fPMOw==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <link rel="stylesheet" href="review.css"/> <script src="https://cdnjs.cloudflare.com/ajax/libs/plyr/3.7.8/plyr.min.js" integrity="sha512-vONptKEoKbP1gaC5UkbYDa9OPr04ur4bxaaqT7DAJxGHB2oogtseCPrl5e5hPFokGYotlGNV4d+GM593ka7iNA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script src="https://cdn.jsdelivr.net/hls.js/latest/hls.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js" integrity="sha512-3j3VU6WC5rPQB4Ld1jnLV7Kd5xr+cq9avvhwqzbH/taCRNURoeEpoPBK9pDyeukwSxwRPJ8fDgvYXd6SkaZ2TA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <style> .plyr__caption { background: #000c; background: var(--plyr-captions-background, #000c); border-radius: 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; color: #fff; color: var(--plyr-captions-text-color, #fff); line-height: 185%; padding: 0.2em 0.5em; white-space: pre-wrap; font-size: 21px; } </style> </head> <body> <div class="container"> <div class="card mb-2"> <div class="card-header text-bg-primary"><?php echo $r['video_name'];?></div> <div class="card-body"> <form method="post" id="form_hoan_tra" action="" enctype="multipart/form-data"> <input type="hidden" value="<?php echo $video_id;?>" name="video_id"> <div class="form-group"> <label class="control-label">Epi name</label> <input type="text" name="f[epi_name]" value="<?php echo $r['epi_name'];?>" class="form-control"> </div> <div class="form-group"> <label class="control-label">File name</label> <input type="text" name="f[video_name]" value="<?php echo $r['video_name'];?>" class="form-control"> </div> <div class="form-group"> <label class="control-label">Subtitles / captions (.vtt or .srt)</label> <input type="file" name="subtitle" class="form-control"> <?php if(isset($r) and $r['subtitle']!='' and file_exists($r['subtitle'])){ echo '[<a href="play.php?type=delete_subtitle&id='.$video_id.'">Delete Subtitle</a>]'; } ?> </div> <input type="submit" class="submit" style="display:none;" name="submitbt"> </form> </div> <div class="card-footer"> <a class="gui_yeu_cau btn btn-danger" href="javascript:void(0);">Update</a> <a class="dong m-l-5 btn btn-dark" href="javascript:void(0);">Close</a> </div> </div> <div class="card mt-2"> <div class="card-header text-bg-success">review</div> <div class="card-body"> <video controls crossorigin playsinline> <source src="<?php echo str_replace('embed/','anime/',$r['video_link']);?>" type="application/x-mpegURL" /> <track kind="captions" label="English" srclang="en" src="<?php echo $r['subtitle'];?>" default /> </video> <div class="form-group mt2"> <label class="control-label">Get link</label> <textarea class="form-control" rows="5" style="height:50%;" readonly><?php echo $list;?></textarea> </div> </div> </div> </div> <input type="hidden" name="visited" id="visited" value="0" /> <script> function setPlayerStartingPosition(player) { var video_start_time = document.getElementById("visited").value; var video_start_time = Math.floor(video_start_time); if (video_start_time > 0) { /*if(confirm('Click "OK" to continue watching, Click "cancel" if you want to watch video again from the beginning?')){ }else{ video_start_time = 0; }*/ $('<div class="plyr__controls__item plyr__spacer"></div>').insertBefore(".plyr__progress__container"); video_start_time = 0; player.on('loadeddata', function (event) { var instance = event.detail.plyr; if (video_start_time <= instance.duration) { instance.off('loadeddata', event); instance.currentTime = video_start_time; } }); } } document.addEventListener("DOMContentLoaded", () => { const video = document.querySelector("video"); const source = video.getElementsByTagName("source")[0].src; // For more options see: https://github.com/sampotts/plyr/#options // captions.update is required for captions to work with hls.js const defaultOptions = { storage: { enabled: true, key: 'plyr--lib-332723' }, fullscreen: { enabled: true, fallback: true, iosNative: true }, iconUrl: 'https://assets.mediadelivery.net/plyr/3.7.3.2/plyr.svg', captions: { active: true, language: 'English', update: true }, controls: <?php $arr_control = control_player(); if(!file_exists($r['subtitle'])){ foreach($arr_control as $key=>$control){ if($control=='captions'){ $key_control = $key; } } if(isset($key_control)){ unset($arr_control[$key_control]); } } $txt_check = ''; if(!empty($arr_control)) { $txt_check = "['" . implode("','", $arr_control) . "']"; } echo $txt_check; ?>, settings: ['captions','quality', 'speed', 'loop', 'audioTrack'], speed: { selected: 1, options: [0.5,0.75,1,1.25,1.5,1.75,2,4] }, i18n: { restart: 'Restart', rewind: 'Rewind {seektime}s', play: 'Play', pause: 'Pause', fastForward: 'Forward {seektime}s', seek: 'Seek', seekLabel: '{currentTime} of {duration}', played: 'Played', buffered: 'Buffered', currentTime: 'Current time', duration: 'Duration', volume: 'Volume', mute: 'Mute', unmute: 'Unmute', enableCaptions: 'Enable captions', disableCaptions: 'Disable captions', download: 'Download', enterFullscreen: 'Enter fullscreen', exitFullscreen: 'Exit fullscreen', frameTitle: 'Player for {title}', captions: 'Captions', settings: 'Settings', pip: 'PIP', menuBack: 'Go back to previous menu', speed: 'Speed', normal: 'Normal', quality: 'Quality', loop: 'Loop', start: 'Start', end: 'End', all: 'All', reset: 'Reset', disabled: 'Disabled', enabled: 'Enabled', advertisement: 'Ad', qualityBadge: { 2160: '4K', 1440: 'HD', 1080: 'HD', 720: 'HD', 576: 'SD', 480: 'SD', }, }, }; if (Hls.isSupported()) { // For more Hls.js options, see https://github.com/dailymotion/hls.js const hls = new Hls(); hls.loadSource(source); // From the m3u8 playlist, hls parses the manifest and returns // all available video qualities. This is important, in this approach, // we will have one source on the Plyr player. hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) { // Transform available levels into an array of integers (height values). const availableQualities = hls.levels.map((l) => l.height) // Add new qualities to option defaultOptions.quality = { default: availableQualities[0], options: availableQualities, // this ensures Plyr to use Hls to update quality level forced: true, onChange: (e) => updateQuality(e), } // Initialize here const player = new Plyr(video, defaultOptions); player.on('timeupdate', () => { const currentTime_player = player.currentTime; $('#visited').val(currentTime_player); }); setPlayerStartingPosition(player); }); hls.attachMedia(video); window.hls = hls; } else { // default options with no quality update in case Hls is not supported const player = new Plyr(video, defaultOptions); } function updateQuality(newQuality) { window.hls.levels.forEach((level, levelIndex) => { if (level.height === newQuality) { console.log("Found quality match with " + newQuality); window.hls.currentLevel = levelIndex; } }); } }); function checkRefresh() { if( document.refreshForm.visited.value == "" ) { // This is a fresh page load document.refreshForm.visited.value = "1"; // You may want to add code here special for // fresh page loads } else { // This is a page refresh // Insert code here representing what to do on // a refresh alert('Xem lại từ đầu hoặc Tiếp tục xem: '+$.cookie("currentTime_player")); } } </script> <script> /*$(".gui_yeu_cau").click(function(){ $("textarea").select(); document.execCommand('copy'); });*/ $('.gui_yeu_cau').click(function (){ $('#form_hoan_tra .submit').click(); return false; }); $('.dong').click(function (){ window.close(); }); </script> <?php $DB->free_result(); $DB->close_db(); ?>