Commit 70442411 authored by Steel Wagstaff's avatar Steel Wagstaff

Adds HTML5 audio embed support for .mp3 links

Code clean up (removed H5P embed test)
parent dcd1b2ca
......@@ -102,6 +102,7 @@ var embedGenerators = [
return null;
},
// Matches URLs that have .mp3 in them (assumed to be audio files)
function html5audioFromMp3Link(link) {
if (link.href.toLowerCase().indexOf('.mp3') !== -1) {
return mp3audio(link.href);
......@@ -109,12 +110,6 @@ var embedGenerators = [
return null;
},
function h5pFromEmbedLink(link) {
if (link.href.toLowerCase().indexOf('admin-ajax.php?action=h5p_embed&id=') !== -1) {
return iframe(link.href);
}
return null;
}
];
/**
......
......@@ -109,13 +109,6 @@ describe('media-embedder', function () {
});
})
/** it('replaces H5P activity links with iframes', function(){
* var urls = [
* 'https://h5p.org/h5p/embed/617'
* ]
* }
*/
it('does not replace links if the link text is different', function () {
var url = 'https://youtu.be/QCkm0lL-6lc';
var element = domElement('<a href="' + url + '">different label</a>');
......@@ -169,4 +162,4 @@ describe('media-embedder', function () {
assert.equal(
element.children[1].src, 'https://www.youtube.com/embed/abcdefg');
});
});
\ No newline at end of file
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment