Is it possible to force html5 video to play videos with other extensions like normal video?

1

I have this client, who for reasons that only he could understand, recorded thousands of videos and saved them with strange extensions, ending in .ts , .mp3 , .mp4 , .mpg , .blib .reuniao , .banco , .manut , etc ...

Being that all are actually .mpg video files. Again, for reasons only he can understand I can not change anything in the files.

Now he needs to make everything available on his site as he sees the lessons ... naturally I tried to use the basics in HTML5:

<video id="video1" src="https://www.someSite.com/someVideo.blib" >
</video>

But of course it did not play, even that file being .mpg normal ... Detail: If I change the extension of files .blib to .mpg , the videos run!

I tried configuring the .htaccess on the server to tell the browser the video format but I was not very happy ...

#Vídeo
AddType video/mp4 .mp4 .m4v
AddType video/mpg .mpg
AddType video/ts .ts
AddType video/blib .blib
AddType video/reuniao .reuniao
AddType video/banco .banco
AddType video/manut .manut

Now, my question ..
How can I make html5-video play the video file with different extensions?

    
asked by anonymous 31.05.2017 / 05:11

3 answers

1

I understood your case with the different extensions, maybe the video tag will cause some problems for you. Recently I worked on a project with videos and had to deal with the formats using FFMPEG to export in MP4 and played them using MediaElement link

This player is very cool and uses the video tag as a base, but it maintains the same style / theme in all browsers, as well as support for formats like flv and even streaming.

I just did a test and this player worked for a .mp4 file renamed to .bank file, but in the base video tag to mount the player I kept the type="video / mp4" attribute

I set up an example with everything you need to make it work

<link rel="stylesheet" href="mediaelement/build/mediaelementplayer.css">
<script src="mediaelement/build/mediaelement-and-player.js"></script>
<script src="mediaelement/build/lang/pt-br.js"></script>

<video class="player" controls preload="false" width="640" height="360" controlsList="nodownload">
    <source src="videos/arquivo.banco" type="video/mp4">
</video>

To activate the plugin:

mejs.i18n.language('pt-BR'); //Traduz o player

$('video.player').mediaelementplayer({
    pluginPath: "mediaelement/build/",
    stretching: 'responsive'
});
    
13.07.2017 / 21:31
-1

If I understand correctly, you want the browser to play a video.ts in video.mp4, is that it? It does not spin. If it is in the construction of the site that is to pull a video.ts file, it will fetch, if not find it will return null ..

    
31.05.2017 / 05:46
-1

From what I understand, your problem is in the extension of the video, correct? I tested using Chrome and it worked quietly with different extension (.blib, .bank, etc.)

Whatever your problem, it's easy for you to try using a video player instead of using HTML5 directly ...

I recommend trying the jwplayer , or some alternatives that are in this site (I have used some and are functional).

    
31.05.2017 / 08:59