Search code examples
htmlinternet-exploreractivexbrowser-plugin

Video in local file system won't play from sibling folder


I am maintaining an HTML help system where assets have recently been split apart from HTML documents. I'm noticing that videos that will play when loaded from a local subfolder will not play when loaded from a sibling folder.

Here's a much reduced example: webroot/dir/a.html contains:

<html><body>
Here's a video:<p>
<object id="mediaPlayer" width="640" height="480"
        classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
        codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
        type="application/x-oleobject">
    <param name="fileName" value="../siblingdir/xxx.wmv">
    <embed type="application/x-mplayer2"
           pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
           id="mediaPlayer" name="mediaPlayer"
           src="../siblingdir/xxx.wmv">
</object>
</body></html>

Even though webroot/siblingdir contains xxx.wmv, the video will not play.

HOWEVER, if I drop the two "../siblingdir" elements in the above code and store the video in the same folder as the web page, the video will play.

Images will load from a sibling directory.

Can the video be made to play from a sibling folder? It this a security setting? Is it something that can be enabled or disabled?

Test platform is MSIE 11 on Windows 7 Enterprise.


Solution

  • <object id="mediaPlayer" width="640" height="480"
            type="application/x-oleobject" data="../siblingdir/xxx.wmv">
        <embed type="application/x-mplayer2"
               id="mediaPlayer" name="mediaPlayer"
               src="../siblingdir/xxx.wmv"/>
    </object>
    

    It is best if you publish your web page to a web server (localhost) or if you are using the local file system, publish your video files to the same windows folder as your source html file. Adjust the Advanced tab of Internet Options to "Allow active content in files on my computer to run.". eg. src="xxx.wmv"