# 如何嵌入托管在我们网站上的视频？

**URL:** https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078
**Category:** Feature
**Created:** [2018年七月25日 06:39 UTC](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078 "2018-07-25T06:39:35Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![EGreg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/egreg/32/133614_2.png) [@EGreg](https://meta.discourse.org/u/EGreg)
#### Post date: [2018年七月25日 06:39 UTC](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078/1 "2018-07-25T06:39:35Z")

</div>

We have a forum at [forum.intercoin.org](http://forum.intercoin.org) that we installed, but we are not Ruby or Discourse experts.

Currently we have been hosting our videos on YouTube and embedding them. But for regulatory reasons, we’d like to bring the videos “in-house” and set the metadata of the page to allow sharing. The idea is that people will see the thumbnail, title and description but not the video outside our site, and we must put custom disclaimers when people visit, before they can see the video.

Is there a plugin for this? If not, would anyone on this site be interested in developing one for us for $$? Please contact me at greg+d @at[intercoin.org](http://intercoin.org) .

It would probably need a custom player that plays videos in a format accepted by all browsers. And lets admins manage metadata for some topics’ pages.

---

<div class="post-metadata">

### Author: ![EGreg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/egreg/32/133614_2.png) [@EGreg](https://meta.discourse.org/u/EGreg)
#### Post date: [2018年七月26日 15:42 UTC](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078/2 "2018-07-26T15:42:05Z")

</div>

Just wanted to bump this up. Can anyone help?

---

<div class="post-metadata">

### Author: ![ryanerwin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ryanerwin/32/94589_2.png) [@ryanerwin](https://meta.discourse.org/u/ryanerwin)
#### Post date: [2018年七月26日 15:57 UTC](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078/3 "2018-07-26T15:57:05Z")

</div>

If you need something custom you should probably rewrite this as a post in #Marketplace

There are lots of 3rd party video player alternatives, the trick is how to make your streaming videos perform well regardless of viewer location.

If you just want to restrict access to only viewing from your site, Vimeo can do that…and the “integration” is just pasting in the Vimeo URL.

---

<div class="post-metadata">

### Author: ![EGreg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/egreg/32/133614_2.png) [@EGreg](https://meta.discourse.org/u/EGreg)
#### Post date: [2018年七月26日 16:42 UTC](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078/4 "2018-07-26T16:42:43Z")

</div>

The thing is, we can’t use Vimeo or some external host, unless they let us embed the video on our site but NOT allow someone to visit the page on their site, so that the only way they can view the video is by agreeing to our disclaimers first.

Does Vimeo have such an option?

---

<div class="post-metadata">

### Author: ![EGreg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/egreg/32/133614_2.png) [@EGreg](https://meta.discourse.org/u/EGreg)
#### Post date: [2018年七月26日 16:43 UTC](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078/5 "2018-07-26T16:43:34Z")

</div>

Ah it appears it does:

- **Hide this video from [vimeo.com](http://vimeo.com) (Plus + PRO + Business + Premium only)** - This video can be embedded on other sites but can’t be viewed on [vimeo.com](http://vimeo.com). (Your video cannot appear in Channels and Groups but can still be added to Albums and Portfolios.)

[https://help.vimeo.com/hc/en-us/articles/224817847-Privacy-settings-overview](https://help.vimeo.com/hc/en-us/articles/224817847-Privacy-settings-overview)

---

<div class="post-metadata">

### Author: ![EGreg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/egreg/32/133614_2.png) [@EGreg](https://meta.discourse.org/u/EGreg)
#### Post date: [2018年七月26日 16:44 UTC](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078/6 "2018-07-26T16:44:15Z")

</div>

What about the disclaimers, etc. ? Can this be done by customizing the theme?

Is that easy to do, or should I hire someone to do it? Is there a link to instructions?

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [2018年七月26日 16:49 UTC](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078/7 "2018-07-26T16:49:38Z")

</div>

> [@EGreg](#):
>
> the only way they can view the video is by agreeing to our disclaimers first.

Should these disclaimers be required when someone signs up to use your site? If you could do that then it would be much easier to just allow the embedding of videos directly.

---

<div class="post-metadata">

### Author: ![EGreg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/egreg/32/133614_2.png) [@EGreg](https://meta.discourse.org/u/EGreg)
#### Post date: [2018年七月26日 17:27 UTC](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078/8 "2018-07-26T17:27:12Z")

</div>

Yes. But the videos may be seen by browsing before signing up.

What do you mean by embedding directly? How? Like a data:// url so it’s a huge page download even if video doesn’t play?

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [2018年七月26日 17:40 UTC](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078/9 "2018-07-26T17:40:48Z")

</div>

> [@EGreg](#):
>
> Yes. But the videos may be seen by browsing before signing up.

Yes, that’s true. You could potentially hide videos from anonymous users with CSS, but someone who’s a little savvy could find them so it wouldn’t be particularly secure. You’d need a custom plugin otherwise.

> [@EGreg](#):
>
> What do you mean by embedding directly? How? Like a data:// url so it’s a huge page download even if video doesn’t play?

If the filetype is enabled in your settings, videos can be posted directly as you would with images. The full video isn’t loaded for the user until it’s played. For example:

[https://global.discourse-cdn.com/meta/original/3X/e/6/e60e12cf1e59aebaff9e67c2cf2f5972f462df7e.mp4](https://global.discourse-cdn.com/meta/original/3X/e/6/e60e12cf1e59aebaff9e67c2cf2f5972f462df7e.mp4)

---

<div class="post-metadata">

### Author: ![EGreg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/egreg/32/133614_2.png) [@EGreg](https://meta.discourse.org/u/EGreg)
#### Post date: [2018年七月26日 20:26 UTC](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078/10 "2018-07-26T20:26:32Z")

</div>

What would the actual code be to embed the video?

What file type should the video be?

And what player is used by default?

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [2018年七月26日 20:40 UTC](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078/11 "2018-07-26T20:40:55Z")

</div>

MP4 is probably the best format to use, it’s supported by all modern browsers.

There’s no code required from the poster to embed the video, as long as you have the video filetype set in the `authorized extensions` setting you can upload it or drag it into the composer as if you’re posting an image.

You can also post a link to an externally hosted MP4 on its own line, and it’ll be embedded

For example, putting this link on its own line  
`https://i.imgur.com/cLEzWIh.mp4`

Embeds the video like this:  
[![Imgur](https://global.discourse-cdn.com/meta/original/4X/b/c/3/bc343426240f865f9737fb84b140c40cbcd9aaa9.png "Imgur") ](https://imgur.com/)

The video is embedded using the HTML5 `<video>` tag, which uses your browser’s native player.

---

<div class="post-metadata">

### Author: ![silvacarl](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@silvacarl](https://meta.discourse.org/u/silvacarl)
#### Post date: [2019年十二月4日 01:29 UTC](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078/12 "2019-12-04T01:29:17Z")

</div>

是否可以嵌入无法被复制的视频或视频链接？我们只希望论坛成员能通过论坛访问这些内容。

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [2019年十二月4日 17:46 UTC](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078/13 "2019-12-04T17:46:42Z")

</div>

使用 OBS 进行直播，或使用手机摄像头录制视频，会有问题吗？

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [2019年十二月4日 19:27 UTC](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078/14 "2019-12-04T19:27:34Z")

</div>

即使它们没有做到那一步，大多数视频播放器也会在“网络”标签页中暴露其流量，允许任何人复制出源路径。

---

<div class="post-metadata">

### Author: ![silvacarl](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@silvacarl](https://meta.discourse.org/u/silvacarl)
#### Post date: [2019年十二月4日 20:10 UTC](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078/15 "2019-12-04T20:10:34Z")

</div>

我们将视频存放在 S3 上，并在一个专用浏览器中进行嵌入。当然，有心之人仍然可以获取视频，但至少我们已尽力。🕶

---

<div class="post-metadata">

### Author: ![joen](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@joen](https://meta.discourse.org/u/joen)
#### Post date: [2020年四月29日 09:16 UTC](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078/16 "2020-04-29T09:16:26Z")

</div>

很抱歉打扰旧帖，但我遇到一个问题：我们本地托管的 mp4 文件无法正确嵌入，它们只显示为链接，而不是可播放的视频。示例如下：[https://archive.mpi.nl/forums/t/screencast-creating-an-account-at-the-language-archive/2750](https://archive.mpi.nl/forums/t/screencast-creating-an-account-at-the-language-archive/2750)  
您知道可能是什么问题吗？我已经将“授权扩展名”设置为接受所有文件类型，并在 Markdown 链接化 TLD 中添加了 `nl`。

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2020年四月29日 15:17 UTC](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078/17 "2020-04-29T15:17:20Z")

</div>

让我们看看

`![SampleVideo_1280x720_1mb|video](upload://3ls8bMAIgT1XlHWkVSrCPfi4ONw.mp4) `

我刚刚在这里上传了它。

---

<div class="post-metadata">

### Author: ![tomtjes](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tomtjes/32/131271_2.png) [@tomtjes](https://meta.discourse.org/u/tomtjes)
#### Post date: [2020年五月2日 16:37 UTC](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078/18 "2020-05-02T16:37:17Z")

</div>

看看这个：

> [@Insert Video](https://meta.discourse.org/t/insert-video-component/147651):
>
> discourse2Summary Insert Video adds a composer button that simplifies adding videos with subtitles (VTT format), a poster image and multiple video sources to a Discourse post.eyeglassesPreview [Preview on Discourse Theme Creator](https://discourse.theme-creator.io/theme/Discourse/insert-video)hammer_and_wrenchRepository Link [https://github.com/discourse/discourse-insert-video](https://github.com/discourse/discourse-insert-video)open_bookNew to Discourse Themes? [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) Install this theme component Features Clicking the button triggers a mo…

---

<div class="post-metadata">

### Author: ![joen](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@joen](https://meta.discourse.org/u/joen)
#### Post date: [2020年五月15日 12:11 UTC](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078/19 "2020-05-15T12:11:52Z")

</div>

`![SampleVideo_1280x720_1mb|video](upload://3ls8bMAIgT1XlHWkVSrCPfi4ONw.mp4)`

上传视频时这确实有效，但当我只是想通过链接显示视频时（见我所发的链接），它无法将其识别为视频。我会查看 Thomas 发送的视频组件。

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2020年五月15日 16:44 UTC](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078/20 "2020-05-15T16:44:39Z")

</div>

请单独在一行中尝试

> **[Screencast: creating an account at the Language Archive](https://archive.mpi.nl/forums/t/screencast-creating-an-account-at-the-language-archive/2750)**
>
> This video shows you how to create a new account at the Language Archive.

您需要像这样对视频进行深度链接

`https://www.mpi.nl/corpus/manuals/screencasts/TLA-new_account.mp4`

[https://www.mpi.nl/corpus/manuals/screencasts/TLA-new\_account.mp4](https://www.mpi.nl/corpus/manuals/screencasts/TLA-new_account.mp4)

[下一頁](https://meta.discourse.org/t/how-can-i-embed-videos-hosted-on-our-site/93078.md?page=2)
