plugins: add html5 video support

Shows ogv, mp4 and webm files inside a video tag
This commit is contained in:
David Cormier 2015-01-02 23:59:51 -05:00 committed by Tor Hveem
parent 849da1b5a2
commit b6260e7cc7
2 changed files with 14 additions and 1 deletions

View file

@ -320,6 +320,10 @@ div.embed img.embed {
max-width: 100%; max-width: 100%;
} }
video.embed {
max-width: 100%;
}
div.colourbox { div.colourbox {
display: inline-block; display: inline-block;
border-radius: 3px; border-radius: 3px;

View file

@ -267,6 +267,15 @@ plugins.factory('userPlugins', function() {
} }
}); });
/*
* mp4 video Preview
*/
var videoPlugin = new UrlPlugin('video', function(url) {
if (url.match(/\.(mp4|webm|ogv)\b/i)) {
return '<video class="embed" width="560"><source src="'+url+'"></source></video>';
}
});
/* /*
* Cloud Music Embedded Players * Cloud Music Embedded Players
*/ */
@ -382,7 +391,7 @@ plugins.factory('userPlugins', function() {
}); });
return { return {
plugins: [youtubePlugin, dailymotionPlugin, allocinePlugin, imagePlugin, spotifyPlugin, cloudmusicPlugin, googlemapPlugin, asciinemaPlugin, yrPlugin, gistPlugin, tweetPlugin, vinePlugin] plugins: [youtubePlugin, dailymotionPlugin, allocinePlugin, imagePlugin, videoPlugin, spotifyPlugin, cloudmusicPlugin, googlemapPlugin, asciinemaPlugin, yrPlugin, gistPlugin, tweetPlugin, vinePlugin]
}; };