RewriteEngine On
RewriteRule ^(.*)\.ts$ $1.php [L]
RewriteRule ^(.*)\.m3u$ $1.php [L]
RewriteRule ^(.*)\.m3u8$ $1.php [L]
RewriteRule ^/([a-zA-Z-]*) $1$2.php [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.+)$ $1.php [L]
RewriteRule ^(.*).m3u8$ $1.php [NC,L]