Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>As per your <a href="https://stackoverflow.com/questions/5231817/html5-video-tag-jsf2">previous question</a>, you're referencing the resource in a HTML <code>&lt;video&gt;</code> tag. All URLs in the HTML source code <strong>must</strong> be <code>http://</code> URLs (or at least be relative to a <code>http://</code> URL). Most browsers namely refuse to load resources from <code>file://</code> URLs when the HTML page is itself been requested by <code>http://</code>. You just need to let the URL point to the servlet. If the servlet's <code>doGet()</code> method get hit, then the URL is fine and you should not change it.</p> <p>Your concrete problem is in the way how you open and read the desired file in the servlet. You need to ensure that the <code>path</code> in <code>File file = new File(path)</code> points to a valid location before you open a <code>FileInputStream</code> on it. </p> <pre><code>String path = "file://myip/storage/ogg/VX-276.ogg"; File file = new File(path); // ... </code></pre> <p>If the servlet code is well written that it doesn't suppress/swallow exceptions and you have read the server logs, then you should have seen an <code>IOException</code> such as <code>FileNotFoundException</code> along with a self-explaining message in the server logs whenever reading the file fails. Go read the server logs.</p> <hr> <p><strong>Update</strong> as per the comments, it turns out that you're using Windows and thus <code>file://</code> on a network disk isn't going to work for Java without mapping it on a drive letter. You need to map <code>//myip</code> on a drive letter first, for example <code>X:</code>.</p> <pre><code>String path = "X:/storage/ogg/VX-276.ogg"; File file = new File(path); // ... </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload