|
|
@ -1,8 +1,13 @@ |
|
|
|
'use strict'; |
|
|
|
'use strict'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function postAudio(args) { |
|
|
|
|
|
|
|
let src = args[0].trim() |
|
|
|
|
|
|
|
return `<p><audio controls preload><source src='${src}' type='audio/mp3'>Your browser does not support the audio tag.</audio></p>`; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function postVideo(args) { |
|
|
|
function postVideo(args) { |
|
|
|
let src = args[0].trim() |
|
|
|
let src = args[0].trim() |
|
|
|
return `<video controls preload><source src='${src}' type='video/mp4'>Your browser does not support the video tag.</video>`; |
|
|
|
return `<p><video controls preload><source src='${src}' type='video/mp4'>Your browser does not support the video tag.</video></p>`; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function postVideos(args, content) { |
|
|
|
function postVideos(args, content) { |
|
|
@ -19,5 +24,6 @@ function postVideos(args, content) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hexo.extend.tag.register('audio', postAudio); |
|
|
|
hexo.extend.tag.register('video', postVideo); |
|
|
|
hexo.extend.tag.register('video', postVideo); |
|
|
|
hexo.extend.tag.register('videos', postVideos, {ends: true}); |
|
|
|
hexo.extend.tag.register('videos', postVideos, {ends: true}); |