Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
70442411
Commit
70442411
authored
Jul 21, 2017
by
Steel Wagstaff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds HTML5 audio embed support for .mp3 links
Code clean up (removed H5P embed test)
parent
dcd1b2ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
14 deletions
+2
-14
media-embedder.js
src/sidebar/media-embedder.js
+1
-6
media-embedder-test.js
src/sidebar/test/media-embedder-test.js
+1
-8
No files found.
src/sidebar/media-embedder.js
View file @
70442411
...
...
@@ -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
;
}
];
/**
...
...
src/sidebar/test/media-embedder-test.js
View file @
70442411
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment