Skip to content

Commit e2ae7da

Browse files
committed
feat(liveleak): Support for liveleak video embedding added
1 parent 4251c65 commit e2ae7da

2 files changed

Lines changed: 24 additions & 3 deletions

File tree

src/modules/video/liveleak.es6

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import Video from './video.es6';
2+
3+
class LiveLeak extends Video{
4+
constructor(input,options, embeds){
5+
super(input, options, embeds);
6+
this.regex = /liveleak.com\/view\?i=[a-zA-Z0-9_]+/gi;
7+
}
8+
9+
template(match){
10+
var dimensions = this.dimensions();
11+
let template =
12+
`<div class="ejs-video">
13+
<iframe src="http://www.liveleak.com/e/${match.split('=')[1]}" height="${dimensions.height}" width="${dimensions.width}"></iframe>
14+
</div>`;
15+
return template;
16+
}
17+
}
18+
19+
module.exports = LiveLeak;

src/modules/video/videoEmbed.es6

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import utils from '../utils.es6';
1+
import utils from '../utils.es6';
22

3-
import Ted from './ted.es6';
3+
import Ted from './ted.es6';
44
import Dailymotion from './dailymotion.es6';
5-
import Ustream from './ustream.es6';
5+
import Ustream from './ustream.es6';
6+
import LiveLeak from './liveleak.es6';
67

78
class VideoEmbed {
89
constructor(input, output, options, embeds) {
@@ -20,6 +21,7 @@ class VideoEmbed {
2021
embeds = utils.ifEmbed(this.options, 'ted') ? await (new Ted(input, this.options, embeds).process()) : output;
2122
embeds = utils.ifEmbed(this.options, 'dailymotion') ? await (new Dailymotion(input, this.options, embeds).process()) : output;
2223
embeds = utils.ifEmbed(this.options, 'ustream') ? await (new Ustream(input, this.options, embeds).process()) : output;
24+
embeds = utils.ifEmbed(this.options, 'liveleak') ? await (new LiveLeak(input, this.options, embeds).process()) : output;
2325

2426
return [output, embeds];
2527
} catch (error) {

0 commit comments

Comments
 (0)