Is it possible to force Html5 video to play videos with other extensions, as if it were normal video?

Asked

Viewed 332 times

1

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

All of which are actually video files .mpg. AGAIN, For reasons that only he can understand I can not modify anything in the files.

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

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

But of course you didn’t, even though that file was .mpg normal... Detail: change the file extension .blib for .mpg, the videos run!

I tried to configure . htaccess on the server to inform the browser the video format but 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 I ask you..
How can I make Html5-video play the video file with different extensions?

  • What @Lucasbarroso answered makes sense, see: https://media.giphy.com/media/3ohze06NBH8AQbVvS8/giphy.gif

  • Most likely your problem is the video codecs

  • If the edition has changed the meaning of the question, you can revert to the previous state... :)

  • Explain what you wanted to know then, in my understanding it was precisely the file extension :) If it is not that, your question can be closed as unclear...

  • Agora ele precisa disponibilizar tudo no site dele como vide-o aulas This is why he did what he did. This is an uncle. And Murphy’s uncertainty principle says that the more ancient the user, the more wrong he’ll do when he has access to a computer.

  • 1

    Hello @Renan, I like philosophy! Thanks for your input. But the question seems simpler to me. The client wants? (YES) ... He’ll pay for it? (YES) Some people can do it? (YES) The client will use it. His way? (YES) I’ll have to use that (No, use whoever you want) we can insist on him using how we found the right ?? (I don’t know, everyone spends their time as they please) Worth convincing the client? (sei la... he’s going to wear it inside his room, within four walls, with his student) then, ta solved. It’s not my money, so.

Show 1 more comment

3 answers

1

I understand your case with the different extensions, maybe the tag video causes some problems for you. Recently I worked on a project with videos and had to treat the formats using FFMPEG to export in MP4 and played them using Mediaelement http://www.mediaelementjs.com/

This player is very cool and uses the video tag as a base, but keeps the same style/theme (handsome) in all browsers, as well as support 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 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'
});
  • Ola Evandro, thanks for the answer, I will study this player already, inclusive to looking for an example to play streaming (from a source that provides videos in .TS).. but it’s hard... if it’s not too hard.. I could put a code in fidle? I’m new and I’m studying... I’d appreciate the help...

  • for example, how to play streaming "http://dveo.com/downloads/TS-sample-files/San_Diego_Clip.ts" ??? __1) Today I put this URL in the browser... it asks to save.. __2) I put myself in the example you gave. it does nothing....

  • @Camilayamamoto created a Fiddle with the same code I used in the reply, in the example I had to use a public video with the extension . mp4, but I’ve tested it running local and it works for you. See example https://jsfiddle.net/o28bojLc/

  • look I think I’m missing something because, in the example with the public video "dveo.com/downloads/TS-sample-files/San_diego_clip.ts" la da http://diveo.com, não vai... e JUSTAMENTE esse tipo de extenssao... eh meu problema atual... por favor.. can give me a light? has how to create the .M3U or .M3U8 local, "pointing" to that remote file from the public example???? help!!!

  • In the original question you do not comment anything about streaming... I did the test using this player with a local mp4 file renamed with different extension, and it worked, that for me was what you were needing. I saw that you have already created another question about this case of M3U, maybe you have confused the issues, but here the solution has already been given in the example I mentioned above

  • yes. voc This song ABOUT THE QUESTION, then I completed in a comment "Ola Evandro, thanks for the answer, I will study this player already, including looking for an example to play streaming (from a source that provides videos on .TS).. but it’s hard... if it’s not too hard.. I could put a code in the fidle? I’m new and I’m studying... I’d appreciate the help.""#right???

  • And then I will ask an example.. ALSO IN THE COMMENTS.... but I guess that no longer matters.. only caused pain and suffering. maybe I’ll open another post.

  • Several people here tried to help you! I posted a solution to what I understood from your question, and answered in the comments what you asked me. Others asked you to give more details about your problem. You answered them all with rudeness. You used high box and sarcasm. Your posture does not suit this community. When reading this you may respond more grossly or even evaluate me negatively... I will not return to this post to continue this matter, but I am sorry for you and your colleagues who tried to help you. Less hate please.

Show 3 more comments

-1

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

  • GOOD... repeating.. """"""""""""""EH ALL . MPG """"""""""""..... the customer I do not know why .. recorded with other names.... HOWEVER in .......

  • Sorry, I can’t help you, it’s very confusing for me this whole... Suddenly you could put an image, an example or something.

  • in the post tilulo.. I put.. FILE WITH WRONG NAME... however . video . mpg

  • It... From what I understand kkkk does not give no... But with an example image would come out easier.

  • image? but what about my problem eh with video... ??! Please how can I give you an example image of a video?

  • When @Sandsoncosta asked for an image, I believe it is an example image of what you want to do :) You got it wrong

Show 1 more comment

-1

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

Whatever your problem, it doesn’t cost you to try using some video player instead of using direct HTML5...

I recommend trying the jwplayer, or some alternatives that are in this website (I’ve used some and they’re functional).

  • thanks for the help, ____1) but I used the above code, and it didn’t work! _____2) I know jwplayer and I tried it with it too! ____ 3) if I change the file extension works! ____ 4) I could post your code? thanks!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.