Skip to content
Snippets Groups Projects
Commit 41852253 authored by George Secrieru's avatar George Secrieru
Browse files

Added oEmbed video support.

parent 22432bb9
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