|
Server IP : 10.2.73.233 / Your IP : 216.73.216.59 Web Server : Apache/2.4.59 (Debian) System : Linux polon 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64 User : www-data ( 33) PHP Version : 5.6.40-64+0~20230107.71+debian10~1.gbp673146 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0750) : /home/leksykografia/../dialektologia/web/classes/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
class mediaclass
{
public static function GetMp3FilenameFromBigMessyContent($subjectcontent)
{
$regexpattern1 = '/param name=("|\')flashvars("|\') value=("|\')file=(.+)(&|&)backcolor=818947(&|&)frontcolor=eaf2b9/';
$regexpattern1a = '/param value=("|\')file=(.+)(&|&)backcolor=818947(&|&)frontcolor=eaf2b9/';
$regexpattern2 = '/<embed (.+) flashvars="file=(.+)(&|&)backcolor=818947(&|&)frontcolor=eaf2b9(&|&)lightcolor=eaf2b9(&|&)screencolor=818947/';
//not use f12, use "show source" in chrome, you will see more
//1
preg_match($regexpattern1, $subjectcontent, $matches);
if($matches !=null && strpos($matches[4],'.mp3')!==false) return $matches[4];
//1a
preg_match($regexpattern1a, $subjectcontent, $matches);
if($matches !=null && strpos($matches[2],'.mp3')!==false) return $matches[2];
//2
preg_match($regexpattern2, $subjectcontent, $matches);
if($matches !=null && strpos($matches[1],'.mp3')!==false) return $matches[1];
}
public static function GetHtml5AudioMarkupByMp3FilenameWithDir($mp3Filename)
{
$ret='
<div style="display:block;"><audio controls controlsList="nodownload" style="width: 100%;margin-top: 5px;">
<source src="'.$mp3Filename.'" type="audio/mpeg">
Twoja przeglÄ…darka nie wspiera elementu audio.
</audio></div>
';
return $ret;
}
}