Assuming you want php and your html is in $html:
Code:
<?php
$html = "so.addVariable('file','http://media.domain.com/videos/filename.mp4');";
preg_match("/so.addVariable\('file','([^']*)'\);/", $html, $regs);
$mp4_url = $regs[1];
echo "$mp4_url\n";
?>