Skip to content

Instantly share code, notes, and snippets.

View beaufortfrancois's full-sized avatar
🏠
Working from home

François Beaufort beaufortfrancois

🏠
Working from home
View GitHub Profile
@beaufortfrancois
beaufortfrancois / mse-promisified.js
Last active April 9, 2018 11:47
MSE promisified
// In an ideal world, MSE would be that simple...
const mediaSource = new MediaSource()
video.srcObject = mediaSource
await mediaSource.ready
const sourceBuffer = mediaSource.addSourceBuffer('video/mp4')
const response = await fetch('https://example.com/init.mp4')

Use cases

User enters PiP User resizes PiP window User exits PiP

Proposal #1