diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 3a6b7be..ac745be 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -3,7 +3,8 @@ import footnote from 'markdown-it-footnote'; import tailwindcss from '@tailwindcss/vite'; import llmstxt from 'vitepress-plugin-llms'; import { HeadConfig } from 'vitepress'; -// @ts-expect-error This file gets generated once docs:generate is run +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore This file gets generated once docs:generate is run import apiRoutes from '../api/index.json'; import m3u8Grammar from './m3u8-grammar.json' with { type: 'json' }; @@ -39,9 +40,10 @@ export default withMermaid({ // https://vitepress.dev/reference/default-theme-config nav: [ { text: 'Guide', link: '/guide/introduction', activeMatch: '/guide' }, - { text: 'API', link: '/api/', activeMatch: '/api' }, + { text: 'API', link: '/api', activeMatch: '/api' }, { text: 'LLMs', link: '/llms', activeMatch: '/llms' }, { text: 'Examples', link: '/examples', activeMatch: '/examples' }, + { text: 'Blog', link: '/blog', activeMatch: '/blog' }, { text: 'Sponsors', link: '/#sponsors', activeMatch: '/#sponsors' }, { text: 'License', link: 'https://github.com/Vanilagy/mediabunny#license' }, { @@ -164,7 +166,7 @@ export default withMermaid({ footer: { message: 'Released under the Mozilla Public License 2.0.', - copyright: 'Copyright © 2026-present Vanilagy', + copyright: `Copyright © ${new Date().getFullYear()}-present Vanilagy`, }, }, markdown: { diff --git a/docs/assets/german-live-tv.png b/docs/assets/german-live-tv.png new file mode 100644 index 0000000..77be209 Binary files /dev/null and b/docs/assets/german-live-tv.png differ diff --git a/docs/assets/on-air.png b/docs/assets/on-air.png new file mode 100644 index 0000000..f5fc4b8 Binary files /dev/null and b/docs/assets/on-air.png differ diff --git a/docs/blog.data.ts b/docs/blog.data.ts new file mode 100644 index 0000000..980fd82 --- /dev/null +++ b/docs/blog.data.ts @@ -0,0 +1,3 @@ +import { createContentLoader } from 'vitepress'; + +export default createContentLoader('blog/*.md'); diff --git a/docs/blog.md b/docs/blog.md new file mode 100644 index 0000000..481d05b --- /dev/null +++ b/docs/blog.md @@ -0,0 +1,27 @@ +--- +outline: false +--- + + + +

Blog posts

+ + \ No newline at end of file diff --git a/docs/blog/mediabunny-now-supports-hls.md b/docs/blog/mediabunny-now-supports-hls.md new file mode 100644 index 0000000..460574d --- /dev/null +++ b/docs/blog/mediabunny-now-supports-hls.md @@ -0,0 +1,257 @@ +--- +title: Mediabunny now supports HLS! +publishedOn: April 24, 2026 +author: Vanilagy +authorImage: /vani.png +authorLink: https://github.com/Vanilagy +authorSubtitle: Creator of Mediabunny +excerpt: Mediabunny v1.42.0 adds read/write support for HTTP Live Streaming (HLS). This has been in the making for the last ~4 months and is, by far, the biggest addition to Mediabunny since its original release. +--- + + + + + +

{{ $frontmatter.publishedOn }}

+ +

{{ $frontmatter.title }}

+ + + +Mediabunny v1.42.0 adds support for HTTP Live Streaming (HLS). This has been in the making for the last ~4 months and is, by far, the biggest addition to Mediabunny since its original release. Like the rest of Mediabunny, it has been implemented from scratch with zero dependencies and is tiny (adds about ~30 kB of additional bundle size). + +If you wanna jump right into detailed guides for reading and writing HLS, check out [Reading HLS](../guide/reading-hls) and [Writing HLS](../guide/writing-hls). For the full release notes, see [v1.42.0](https://github.com/Vanilagy/mediabunny/releases/tag/v1.42.0). + +## What is HTTP Live Streaming (HLS)? + +For those unfamiliar, HLS is a protocol used to stream media over the internet using HTTP. At its core, it chunks a long piece of media (like a TV episode) into many short segments, each of which is individually addressable via HTTP, and then provides an index called a "playlist" to the user telling them about the available segments. The client then requests whichever segments it needs. + +HLS also enables multiple variants and renditions of the same contents. Typically, this means the same video/audio content encoded with multiple bitrates, resolutions and codecs, and multiple audio tracks, one for each language. + +## Supported features + +One of the reasons that HLS has been in the works for so long is because I've been extremely thorough with the supported feature set. + +Mediabunny supports: +- HLS reading **and** writing +- both VOD and live content +- both unencrypted and encrypted content (including DRM-protected content) +- an arbitrary number of video and audio tracks +- any configuration of variant streams and media renditions +- all segment formats (MPEG-TS, CMAF, fMP4, ADTS, MP3, WAV, ...) +- all codecs (H.264, HEVC, AV1, AAC, MP3, WAVE, AC-3, E-AC-3, ...) +- full lazy loading of track metadata and media, minimizing HTTP requests +- logarithmic seeking performance +- single-file segments via #EXT-X-BYTERANGE and HTTP range requests +- track metadata information (language, name, primary track, autoselect, ...) +- full master playlist configuration for writing +- datetime-stamped media data via #EXT-X-PROGRAM-DATE-TIME +- mid-stream discontinuities +- I-frame only video tracks via #EXT-X-I-FRAME-STREAM-INF +- more, probably + +Most of the above features are implemented _symmetrically_, meaning they are available for both reading and writing operations. + +--- + +To be fully transparent, these features are not yet supported: +- Subtitles (WebVTT, CEA-608/708, ...) +- ID3v2 metadata extraction +- Writing encrypted segments +- Low-latency HLS +- Built-in analytics, ABR, or CMCD (this is for the user to do) + +## Difference to existing solutions like hls.js + +The way Mediabunny enables interaction with HLS playlists is fundamentally different from how existing tools such as [hls.js](https://github.com/video-dev/hls.js) (give them a star!) do it. To put it simply, hls.js is to Mediabunny what a `