Skip to content
Snippets Groups Projects
Commit 9a3d7765 authored by Rodrigo Nascimento's avatar Rodrigo Nascimento
Browse files

Merge pull request #1181 from RocketChat/rocketchat-oembed-video-support

Added oEmbed video support
parents d0b13769 41852253
No related branches found
No related tags found
No related merge requests found
Template.oembedBaseWidget.helpers
template: ->
# console.log this
if this._overrideTemplate
return this._overrideTemplate
......@@ -10,6 +9,9 @@ Template.oembedBaseWidget.helpers
if this.headers?.contentType?.match(/audio\/.*/)?
return 'oembedAudioWidget'
if this.headers?.contentType?.match(/video\/.*/)?
return 'oembedVideoWidget'
if this.parsedUrl?.host is 'www.youtube.com' and this.meta?.twitterPlayer?
return 'oembedYoutubeWidget'
......
<template name="oembedVideoWidget">
{{#if parsedUrl}}
<blockquote>
<video controls class="inline-video">
<source src="{{url}}" type="{{headers.contentType}}">
Your browser does not support the video element.
</video>
</blockquote>
{{/if}}
</template>
......@@ -21,6 +21,7 @@ Package.onUse(function(api) {
api.addFiles('client/oembedImageWidget.coffee', 'client');
api.addFiles('client/oembedAudioWidget.html', 'client');
api.addFiles('client/oembedVideoWidget.html', 'client');
api.addFiles('client/oembedYoutubeWidget.html', 'client');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment