A
A
Alexey Kopendakov2018-05-06 11:30:16
Java
Alexey Kopendakov, 2018-05-06 11:30:16

How to correctly implement the return of a jsf 2.2 video / audio file?

Tell me where you can peep exactly the WORKING code, how to correctly implement the video display on the site.
The site itself will spin on apache (then I will transfer it to nginx), followed by wildfly. Showing video using html5 tags
Now implemented the return of the video, through the connection omnifaces

public void downloadFace(String fileName) throws IOException{
        File file = new File("/opt/"+fileName);
        Faces.sendFile(file, false);
    }

Works. BUT. - there is no way to "rewind" the file to an arbitrary location.
And if you give the file directly through apache, then everything is fine, rewind to any place, when you refuse to view, there are no error messages that the stream was interrupted .....
In principle, most likely, I will stop on such a scheme in the future, but now for myself, I would like to understand how to properly implement such a file return? Surely this is a common task? and it's all written a long time ago?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question