Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

37 lines
1.2 KiB

<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false );
header("Pragma: no-cache");
if(isset( $_POST['VID'] )){
$VID = intval($_POST['VID']);
} else {
$VID = intval($_GET['VID']);
};
if( $VID ){
$QS = "SELECT md5, part_id FROM video_records WHERE id={$VID}";
$Result = $DATABASE->Query( $QS, false );
if( count( $Result ) ){
$SP = intval($Result[0]['part_id']);
$MD5 = $Result[0]['md5'];
$QS = "SELECT part_id FROM video_records WHERE md5='{$MD5}' AND part_id >= {$SP} ORDER BY part_id";
$RR = $DATABASE->Query( $QS, false );
echo"#EXTM3U\n";
echo"#EXT-X-VERSION:3\n";
echo "#EXT-X-ALLOW-CACHE:NO\n";
echo "#EXT-X-TARGETDURATION:2\n";
echo "#EXT-X-MEDIA-SEQUENCE:73598\n";
//echo "#EXTINF:1.960,\n2021-07-11/09/53-34_73598.ts\n";
$BD = substr( $MD5, 0, 2 ) . '/' . substr( $MD5, 2, 2 ) . '/';
foreach( $RR as $R ){
$CP = intval( $R['part_id'] );
echo "#EXTINF:1.960,\ndata/videos/{$BD}{$CP}.ts\n";
};
echo "#EXT-X-ENDLIST\n";
exit();
};
};
};
header('location: /');
?>