# M3U8 file support

**URL:** https://meta.discourse.org/t/m3u8-file-support/293584
**Category:** Development
**Tags:** onebox
**Created:** [January 31, 2024, 3:29am UTC](https://meta.discourse.org/t/m3u8-file-support/293584 "2024-01-31T03:29:58Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Creatures\_Prehistori](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/creatures_prehistori/32/329607_2.png) [@Creatures\_Prehistori](https://meta.discourse.org/u/Creatures_Prehistori)
#### Post date: [January 31, 2024, 3:29am UTC](https://meta.discourse.org/t/m3u8-file-support/293584/1 "2024-01-31T03:29:58Z")

</div>

I wish to play m3u8 video files within my post.  
What methods are available for parsing video links?  
I encountered an error when pasting the video link:  
Sorry, we were unable to generate a preview for this web page, because the following oEmbed / OpenGraph tags could not be found: description, image

---

<div class="post-metadata">

### Author: ![Creatures\_Prehistori](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/creatures_prehistori/32/329607_2.png) [@Creatures\_Prehistori](https://meta.discourse.org/u/Creatures_Prehistori)
#### Post date: [January 31, 2024, 3:55am UTC](https://meta.discourse.org/t/m3u8-file-support/293584/2 "2024-01-31T03:55:13Z")

</div>

My fundamental query is about how to play streaming videos in posts and what formats are supported.

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [January 31, 2024, 11:43pm UTC](https://meta.discourse.org/t/m3u8-file-support/293584/3 "2024-01-31T23:43:49Z")

</div>

Hello,

The HTTP Live Streaming (HLS) links are not supported as onebox.

What you can do is to use the `<video>` HTML tag.  
For example:

```html
<video controls preload="metadata">
  <source src="https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.m3u8" type="application/x-mpegURL" />
</video>

```

You can use this [Insert Video](https://meta.discourse.org/t/insert-video/147651) component to insert the `<video>` tag easily.

From what I see, the [HLS support](https://caniuse.com/http-live-streaming) is pretty limited to Android/IOS devices, with no major desktop browser except Safari.

If you want to make it work on a Desktop, you will need a third-party library, such as [videojs](https://github.com/videojs/video.js), and a Theme component to integrate it.

---

<div class="post-metadata">

### Author: ![Creatures\_Prehistori](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/creatures_prehistori/32/329607_2.png) [@Creatures\_Prehistori](https://meta.discourse.org/u/Creatures_Prehistori)
#### Post date: [February 17, 2024, 5:13pm UTC](https://meta.discourse.org/t/m3u8-file-support/293584/4 "2024-02-17T17:13:04Z")

</div>

I wanna use videojs to play HLS videos.  
I change `discourse/lib/oneboxer.rb`  
add this code :

```plaintext
module Oneboxer
  ONEBOX_CSS_CLASS = "onebox"
  AUDIO_REGEX = /\A\.(mp3|og[ga]|opus|wav|m4[abpr]|aac|flac)\z/i
  VIDEO_REGEX = /\A\.(mov|mp4|webm|m4v|3gp|ogv|avi|mpeg|ogv)\z/i
  HLS_REGEX = /\A\.(m3u8)\z/i

 ***other code 
    when HLS_REGEX
      <<~HTML
      <script src="https://vjs.zencdn.net/8.10.0/video.min.js"></script>
      <link href="https://vjs.zencdn.net/8.10.0/video-js.css" rel="stylesheet" />
      <div class="onebox video-onebox">
        <video-js #{additional_controls} width="100%" height="100%" class="vjs-default-skin" controls>
          <source src="#{normalized_url}">
        </video-js>
      </div>
      HTML

```

then I change discourse-docker project. I replace `https://github.com/discourse/discourse.git`  
to my changed project.  
I replace these files:

```plaintext
image/base/slim.Dockerfile
image/discourse_dev/postgres_dev.template.yml

```

But It not work.  
If anyone can fix this feature?  
I can pay for it.

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [February 17, 2024, 9:54pm UTC](https://meta.discourse.org/t/m3u8-file-support/293584/5 "2024-02-17T21:54:13Z")

</div>

You can post a topic in #Marketplace or even move this topic there and edit the OP a bit.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [March 18, 2024, 9:54pm UTC](https://meta.discourse.org/t/m3u8-file-support/293584/6 "2024-03-18T21:54:24Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
