-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
34 lines (31 loc) · 1.03 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* jshint node: true */
'use strict';
module.exports = {
name: 'ember-cli-plyr',
included: function(app) {
this._super.included(app);
// Load bower assets.
app.import(app.bowerDirectory + '/plyr/dist/plyr.js');
app.import(app.bowerDirectory + '/plyr/dist/plyr.css');
app.import(app.bowerDirectory + '/plyr/dist/sprite.svg', { destDir: 'sprites' });
},
contentFor: function(type, config) {
if (type === 'body') {
// Load SVG icons for video player.
return '<script>\
(function(d,p){\
var a=new XMLHttpRequest(),\
b=d.body;\
a.open("GET",p,!0);\
a.send();\
a.onload=function(){\
var c=d.createElement("div");\
c.style.display="none";\
c.innerHTML=a.responseText;\
b.insertBefore(c,b.childNodes[0])\
}\
})(document,"sprites/sprite.svg");\
</script>';
}
}
};