//解析m3u8文件,获取视频总时长
private function getDuration($uri){
try{
$res = file_get_contents($uri);
}catch(\ErrorException $e){
return 0;
}
preg_match_all('/\d+[.]\d+/',$res,$arr);
$res = array_sum($arr[0]);
return (int)$res;
}