插入视频和音频

其他博客在插入视频和音频的时候都有相应的代码,markdown在这方面也有相应的优化,而且hexo也有自己的标签,这里稍微介绍下,感觉用的机会比较少,但还是介绍下

插入youtubeVimeo视频

{% vimeo video_id %}
{% youtube video_id %}

markdown标签

<video width="480" height="320" controls>
<source src="movie.mp4">
</video>

embed标签

<embed src="http://player.youku.com/player.php/Type/Folder/Fid/27690810/Ob/1/sid/XMTY1MTI3NjMyNA==/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="always" allowFullScreen="true" mode="transparent" type="application/x-shockwave-flash"></embed>

要启用flash 比较讨厌

ifreame标签

<iframe width="560" height="315" src="https://www.youtube.com/embed/I7f5xJqvNQc" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

网易云支持ifreame

网页版示例

其他的hexo插件

为了满足网站对html5以及https的很好支持,推荐APlayerDplayer插件

hexo-tag-aplayer:https://github.com/grzhan/hexo-tag-aplayer#upstream-issue

hexo-tag-dplayer:https://github.com/NextMoe/hexo-tag-dplayer

npm install hexo-tag-dplayer --save
npm install hexo-tag-aplayer --save
{% aplayer "Caffeine" "Jeff Williams" "http://7xq131.com1.z0.glb.clouddn.com/Preparation.mp3" "autoplay" %}
{% dplayer "url=http://devtest.qiniudn.com/若能绽放光芒.mp4" "api=http://dplayer.daoapp.io" "pic=http://devtest.qiniudn.com/若能绽放光芒.png" "id=9E2E3368B56CDBB4" "loop=yes" "theme=#FADFA3" "autoplay=false" "token=tokendemo" %}

具体的参数设置,请参见大佬的github主页。

客官,看我这么可爱,赏点呗