eloquence / lib.reviews

A free/libre code and information platform for reviews of anything
Creative Commons Zero v1.0 Universal
172 stars 13 forks source link

WebM videos don't play in Safari browser (transcode?) #186

Open bvibber opened 6 years ago

bvibber commented 6 years ago

Ah, the fun fun world of video formats. :)

Uploaded WebM or Ogg videos such as on https://lib.reviews/team/developers/post/b0873e50-4830-4603-a765-2f1c16ac3029 don't play as-is on Safari (or on current versions of Edge, though Edge is adding support, currently installable via plugin).

screen shot 2017-12-22 at 4 44 10 pm

There are basically two ways to handle this: transcode to MP4 on the backend (may expose larger licensing issues), or to play them in non-supporting browsers via ogv.js by dynamically swapping out the video or audio element for an OGVPlayer instance.

One potential issue with ogv.js -- currently it looks like you're using the default browser controls on the playback element, and ogv.js doesn't by default ship with control support. I can fix that though. Alternate: use something like video.js as an intermediary.

eloquence commented 6 years ago

Yeah, I figured it wouldn't work in those browsers yet - thanks for taking the time to write up the issues! My thinking right now is to do server-side transcodes of Ogg/WebM to MP4 and vice versa, and to use <source> elements to enumerate the available versions. The H.264 fees seem to kick in only for content that's pay-to-play. ogv.js is very cool though :)

bvibber commented 6 years ago

Great, transcoding is the best way if the licenses aren't an issue! :D