Embedding a video to HTML that does not have the .mp4 filename extension - html5-video

I changed the filename extension of my videos on the server from .mp4 to .zip. Now I want to embed the videos in my HTML web page, but it doesn't work due to the filename extension. I'm looking for a way to tell my front-end how to interpret the embedded file and read it as MPEG-4.

Why did you change the .mp4 to .zip? Video has pretty good compression already, and making it a zip file is unlikely to save you much (if any) in terms of the size of the object.

Related

What are all of OperaGX's supported file types for creating add-ons?

I am trying to create an animated wall paper for OperaGX in the add-ons section, and I've uploaded an .mp4 twice and it's telling me that .mp4 is not supported. I would like to know all of the supported file types that could be accepted, I am currently converting the .mp4 to a .gif .
OperaGX only supports the following file types for creating add-ons: .gif, .jpg, and .png.

Safari - WebkitAudioContext chokes on some mp3 files for unknown reason

I'm having an issue with certain MP3 files in Safari only.
Here's a codepen: https://codepen.io/parliament718/pen/ExjwWEp
In chrome, both buttons work to play both files.
In safari only the first button works.
Why is this? Does safari just choke when it doesn't see a ".mp3" suffix or is it something else?
Both requests return "audio/mp3" Content-Type header.
Both files can be downloaded as mp3s and played in any audio player
Both files can be played directly through the safari address bar
But only one of the files plays programatically using WebkitAudioContext.
Failing code:
window.webkitAudioContext.decodeAudioData(request.response, ...)
Your MP3 file isn't valid. There is multi-part form garbage at the beginning of the file. If you open it with a hex editor, you'll see it:
Anywhere else that's playing this file is simply being nice to you. :-)
Also, use audio/mpeg for your Content-Type header. It doesn't matter in your case since you're using the audio context to decode the data... it doesn't know what the original Content-Type header was. I'm mention it here for others, as it's a common mistake.

How can I get closed-captions embedded inside mp4 file with VideoJS?

I want to use VideoJS in my project, and I also need closed-caption support. I have read the VideoJS docs on how to use a text-track from a WebVTT file, but most of my .mp4 files have captions embedded in the file itself, there is no WebVTT file available. How can I get the captions out of the mp4 using VideoJS?
Edit: We will be live-streaming video, which is why the closed-captions are embedded into a stream.
To do the extraction step, you don't/can't use VideoJS itself. Instead, there are various standalone video editors that can do the job...just do a google-search like 'video tools to extract sub-titles'. Preferably, find/use a tool that extracts subtitles/captions into an "SRT" file-type. Then, to convert into VTT files, there are various tools for that, too. [ For that step,I use the free SRT->VTT converter avail at: http://atelier.u-sub.net/srt2vtt ]

How to read a pdf file by using HTML5?

I want to create html file by which i could read any PDF file by providing the source of that PDF file. How can i do this by using only html5?
For example i want read a pdf file which is available in C drive so scr="http://virdir/mypdf.pdf".
I want something like this.
You want to use the developing HTML 5 File API. Mozilla has a good explanation, and you can also refer directly to the spec.
Since PDF is a binary format, you will probably want to use FileReader.readAsBinaryString().
Parsing and rendering (e.g. to a canvas) a PDF in JavaScript is possible, but it would be very challenging.
Here is an open source pdf reader written in javascript.
https://github.com/mozilla/pdf.js
There are APIs available to play with. It comes built into Firefox browser and has good support from Mozilla community.

OBML file format

Opera mini browser can save HTML pages in OBML (Opera Binary Markup Language) format for offline browsing. I am wondering if I can convert a HTML file to OBML format and save in my phone for later viewing.
For doing so, I need details about the OBML format, which seems to be undocumented. Do you know more details on this OBML format?
Thanks for your time.
I reverse-engineered several OBML format versions and wrote a Python OBML to HTML converter along with format documentation. Generating OBML files might be more difficult, however, as it requires an actual HTML layout engine (all OBML elements are pixel-positioned rects).
A working way to save/open OBML files on your PC
http://java4me.blogspot.com/2008/01/opera-mini-as-pc-browser-big-screen.html
http://my.opera.com/opera.mini/forums/topic.dml?id=234030
Opera MicroEmulator
Nothing yet about OBML.
If the HTML is small in size you can simply upload the HTML to a file host or webspace, then access it using Opera mini then save it as OBML.