2 Replies Latest reply on Sep 7, 2016 6:18 AM by Milan Szabo

    WildFly10 - Simple HTML5 video

    Milan Szabo Newbie

      Hello

       

      I would like to discuss little bit about HTML5 video player deployed on WildFly 10 server and as I didnt find any other similar topic, I have to start my own.

      I am trying to achieve really simple thing (or at least supposedly simple .. in reality it is not) - send one static video MP4 file from my server to browser, nothing more nothing less in current phase.

       

      To eliminate any other influences I am doing that on static HTML page (JSF not involved)

       

      My HTML source code is following

       

      <html>

      <head>

      </head>

       

      <body>

      <video width="320" height="240" controls>

        <source src="video/sample.mp4" type="video/mp4">

      </video>

      </body>

      </html>

       

      Source code on deployed page (when displayed in Chrome) is exactly the same, so no problem so far.

      I can see video player, I can see controlls with correct video length displayed (10 seconds) but no video image is displayed and video cannot be played.

       

      This is what I see in Chrome

       

      videoProblem1.jpg

       

       

      Just to clarify, when I try to simply drag that video file into the browser, it IS PLAYING OK so no problem in video file.

       

      My chrome Developer tool shows following errors - I dont see any useful info behind these canceled requests.

      videoProblem2.jpg

      Apparently, server is somehow unable to provide video file content to the browser and I dont see any suitable reason for that.

       

      One more clue - when I right-click video player in browser and choose "Save video as" then downloaded file has correct name and size

      but that downloaded file cannot be played in any video player and binary content comparator shows little differences.

       

      I think that there must be "something" that corrupt my video file on the way from server to the browser but I have absolutely no clue of what it coud be.

       

      There is no java nor JSF involved, no servlets no filters, my web.xml is following

       

      <?xml version="1.0"?>

      <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

       

      <welcome-file-list>

        <welcome-file>index.html</welcome-file>

      </welcome-file-list>

       

      </web-app>

       

       

      Is here someone else who had tackled with that kind of a problem ?

      I cannot believe that I am the only one who wants to play video files from WildFly server

       

      Thanx in advance for some advice !!!

        • 1. Re: WildFly10 - Simple HTML5 video
          Wolfgang Mayer Master

          Apparently the mp4 causes issues with some browsers (html5 - .mp4 file not playing in chrome - Stack Overflow

          Does your Chrome show the video when you enter the address directly (like file:///{path_to_your_application}/video/sample.mp4)?

          Did you try to convert your movie to another format (like .mov)? ()html5 - How to open .mov format video in HTML video Tag? - Stack Overflow

          • 2. Re: WildFly10 - Simple HTML5 video
            Milan Szabo Newbie

            Hello Wolfgang, I have found the cause of my problem just by good luck.

             

            MP4 file itself is absolutely ok (playable from local filesystem path).

            My problem was caused by CORRUPTION OF FILE during build process with MAVEN - File in the final WAR was somehow damaged (it has correct length but some differences in binary content).

             

            When I build WAR without file inside it and add that video file into WAR after build is completed, then everything works fine.

             

            What is interesting is the fact, that I have found some video files that are not corrupted by maven build and some that are .. it doesnt affect all, but some of them. I cannot say what is the real cause now and why it does not affect all files.

             

            I have tried to use file handlers to serve video files from outside of WAR file but probably file handler doesnt support range requests or I am doing something wrong

            After all my initial problem of unplayable video files is solved, thanx.