如何在Hexo中插入多媒体文件

添加音频

添加音频-本地

没有找到更好看的方法了

1
2
3
4
5
6
<iframe 
frameborder="no" border="0"
marginwidth="0" marginheight="0"
width=50% height=100
src="http://senhai.wang/mp3_list/%E8%BE%BE%E6%8B%89%E8%B9%A6%E5%90%A7.mp3">
</iframe>

添加音频-网易云歌单

type参数和引用的网易云来源有关,0指的是歌单

1
2
3
4
5
6
<iframe 
frameborder="no"
marginwidth="0" marginheight="0"
width=50% height=100
src="//music.163.com/outchain/player?type=0&id=827122421&auto=0">
</iframe>

添加音频-网易云单曲

type为2,指的是单曲

1
2
3
4
5
6
<iframe 
frameborder="no" border="0"
marginwidth="0" marginheight="0"
width=50% height=100
src="//music.163.com/outchain/player?type=2&id=476114873&auto=0">
</iframe>

添加音频-embed标签

此处有音频,自动播放无法取消,无法显示控件
现在被我注释掉了,完全感知不到了

1
<embed controls="controls"  hidden="true" loop="true" src="http://senhai.wang/mp3_list/%E8%BE%BE%E6%8B%89%E8%B9%A6%E5%90%A7.mp3"/>

添加音频-audio标签

此处有音乐,但没有自动播放,audio标签无法正常显示控件

1
<audio controls="controls" > <source src="http://senhai.wang/mp3_list/%E8%BE%BE%E6%8B%89%E8%B9%A6%E5%90%A7.mp3" type="audio/mp3" > </audio>

添加音频-强制html

也并没有用

1
2
3
4
5
6
7
8
9
10
<!DOCTYPE HTML>
<html>
<body>

<audio src="http://senhai.wang/mp3_list/%E8%BE%BE%E6%8B%89%E8%B9%A6%E5%90%A7.mp3" controls="controls">
Your browser does not support the audio element.
</audio>

</body>
</html>

添加视频

可以正常使用

1
2
3
<video id="video" controls="" preload="none" poster="http://img.blog.fandong.me/2017-08-26-Markdown-Advance-Video.jpg">
<source id="mp4" src="http://img.blog.fandong.me/2017-08-26-Markdown-Advance-Video.mp4" type="video/mp4">
</video>

--------------------- ----------------------