mardi 10 février 2015

QML: Video object won't recognize source file type/video format if file name does not contain suffix

I'm trying to play a video (and audio) file in my QML application like this:



Video { source: "ab17cabfa.data" }


The issue is that Qt/QML won't play the video and instead prints a warning message to the console about how it can't recognize the file format.


The problem is, that my video and audio files are named like this because they are referenced from a JSON file for a different purpose, and are already stored on the file system like this, so renaming them is not an option, as this would break other applications that access these files.


PS: Renaming them files by hand (and the source string, of course) as a proof of concept works like expected and the video plays. In my opinion the video player should not use the file name as a file type indicator, instead it should check the file content's headers instead.


Is there a way to "override" this behavior and force the video/audio player to play the file without looking at the file name/suffix?


Aucun commentaire:

Enregistrer un commentaire