Accessing a Desktop Video Player Application from Web Page
<p>Here's what my client wants to be able to do:</p>

<p>Have a link on a web page that contains the local path to a video file. When clicked, the desktop will open the appropriate player and play that file. </p>

<p>Anyone know if this is possible? And if so, how?</p>

<p>Once again I humble myself before the "stackoverflow gods."</p>

<hr>

<p>My client found a workaround! Here's how we're able to play files from your CPU on a web page:</p>

<p>Download VLC Player <a href="http://www.videolan.org/v" rel="nofollow">http://www.videolan.org/v</a></p>

<p>Create a page with a form or a link that sends the local file path. IMPORTANT: you must add slashes using JS or PHP to this path. Otherwise your path will end up looking like C:UserMyFilesMyfile.</p>

<p>Add the following code to a PHP page.</p>

<pre><code>// IF YOUR POST THE FILE PATH
$cfile = $_POST['filepath'];
// IF YOUR SEND THE FILE PATH
$cfile = $_GET['filepath'];

&lt;object id="VLC" classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"
pluginspage="http://www.videolan.org"
version="VideoLAN.VLCPlugin.2"
width="" height="" events="True"&gt;
&lt;param name="file:" value="&lt;?php echo $cfile; ?&gt;"/&gt;
&lt;param name="ShowDisplay" value="True" /&gt;
&lt;param name="AutoLoop" value="no"/&gt;
&lt;param name="AutoPlay" value="true"/&gt;
&lt;embed type="application/x-vlc-plugin"
autoplay="yes"
loop="false"
id="VLC"
pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2"
width="380" height="240"
file:="&lt;?php echo $cfile; ?&gt;"
target="&lt;?php echo $cfile; ?&gt;"
&lt;/embed&gt;
&lt;/object&gt;
</code></pre>

<p>It's not perfect. More often the player crashes upon loading. But, refreshing the page reloads the player and the video works.</p>

<p>We've tested it with mp4,wmv,flv and mov files and it works pretty good.</p>

<p>Hope this helps someone.</p>
