A
A
Alexey Kopendakov2018-04-27 15:51:30
Java
Alexey Kopendakov, 2018-04-27 15:51:30

How to use html5 (video) in jsf application?

Good afternoon.
View construction

<body>.
<video controls preload="auto" autoplay>
    <source src="-xiGLuG3.mp4" type="video/mp4"/>
</video>
</body>

Works with a bang when running on an apach server. Everything is good here.
But, when I insert the same construct into .xhtml file -
<video controls="controls" preload="auto" autoplay="autoplay">
            <source src="-xiGLuG3.mp4" type="video/mp4" />
        </video>

Then only an empty square of the player appears, at the bottom of which is the play button, the time is 0:00 and the gray bar is the scroll bar.
How to overcome - it's not clear :(
PS. The file is definitely available. It will be thrown into the webapp directory. If you substitute the file name instead of the name test.xhtml, then it is downloaded ....
ZYY. If it is important, then the application server is wildfly11

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Kopendakov, 2018-04-27
@alex_kag

I did a bunch of experiments here, and I don’t understand anything at all.
if you specify the path to another server - not wildfly, but to apach standing next to it, then everything turns out to be super - the video is shown. But if the link goes to wildfly, then bummer. and I tried to indicate it in different ways:
None of these methods work - and the file itself is available for download ... And where to dig?
PS. The issue was resolved. I do not give the file with the video directly, but through the stream, since it was actually planned. Thus - it works. Just adding a mime type for mp4 to web.xml was not enough.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question