JW Player Error loading media: File could not be played

Marcus Rommel picture Marcus Rommel · Jun 8, 2015 · Viewed 26.1k times · Source

We ran into a very strange problem with JW Player and really don't know an approach to solve it.

JW Player shows the error:

Error loading media: File could not be played

sporadically across all browsers and platforms (sometimes it shows up and sometimes not). It took me over 30 reloads to get it and some of my colleagues got it with their first try. It's behavior is very inconsistent and kind of random.

We're using FirstSpirit as CMS on an Apache Tomcat instance running on Windows server. The problem occurred on Chrome, IE and Firefox across all versions.

The MIME types of all videos are correct as their codecs are. If supported, JW Player is running in HTML5 mode. We use Flash only for older browsers (IE8 groan).

I would appreciate any help. Thanks!

Marcus


UPDATE: Example page with video box on the right side. Example page with video

UPDATE: We updated the version as Ethan from JW Player suggested, but it's still not working properly.

Answer

Svetoslav Petrov picture Svetoslav Petrov · Aug 24, 2018

I would suggest to encode the video in .mp4 and .ogg. (MP4 is supported in Safari and IE9, Ogg in Firefox, Chrome and Opera and as you mentioned IE6-8 uses flash only). Thus your video element will look something like:

<video width="300" controls>
  <source src="my_video.ogg" type="video/ogg">
  <source src="my_video.mp4" type="video/mp4">
  Your browser does not support HTML5 video.
</video>

This will ensure that the video will be played if the browser support HTML5. I hope this helps