Supersonic
Supersonic

Reputation: 430

Jwplayer: Providing a path from home directory to play videos

I have my jwplayer installed and this is my code:

<div class="video-container">
  <h3 style="color: #467AA7;padding-left: 800px;">Login</h3>
  <div class="video-body" style="padding-left: 700px;">
  <div id="myElement"> Loading the player...</div>
  <script type="text/javascript">jwplayer("myElement").setup({
     file : "/home/user/videos/login.mp4",});
  </script>
  </div>
  <p style="color: #467AA7;padding-left: 700px;font-size:12px; font-style:italic;"></p>
</div>

This is the path of my video : "/home/user/videos/login.mp4" but when i try to access my application it says "Error Loading Media: File Not found" as it is searching for home/user/videos/login.mp4in my application but not going to the server's path. My request is like this in the browser: www.myapp.com/home/user/videos/login.mp4 - 404 not found.

Can you please help me fixing the file path to access the videos from the server's path. Thanks

UPDATE: "./home/user/videos/login.mp4" doesn't work as well. It still stays in my application and passes it with the url.

Upvotes: 1

Views: 1580

Answers (1)

robertklep
robertklep

Reputation: 203286

Try using this instead:

file:///home/user/videos/login.mp4

EDIT: oh wait, you're requesting the page using HTTP. In that case: it's not gonna work. To your browser, those two resources (the html page and the movie file) exist in separate domains, and generally, cross-domain resource access will be blocked by your browser.

Upvotes: 3

Related Questions