? Editing: Post:21.body Save Delete Cancel
Content changed Sign & Publish new content

BinChan's ZeroNotes

Messy Notes about using ZeroNet and other things
All code published here are under CC-BY-SA licence, if not compatible, then MIT license X)

Follow in NewsfeedFollowing

TOC by date
TOC by tag
View in light theme

Latest comments:

Add new post

Title

21 hours ago · 2 min read ·
3 comments

tag:
Body
Read more

Not found

Insert Video and Audio to ZeroBlog

on Feb 08, 2018 · 1 min read
tag: tutorial zeroblog

Add "optional": "media/.*", to content.json of your blog folder and copy the related file to the folder media, then use the format below to insert video or audio. [ref]

For video:

<video src="media/What is GNU Linux.webm" controls preload="none" width="600" style="max-width: 100%;">
Your browser doesn't support HTML5 video. Here is a <a href="media/What is GNU Linux.webm">link to the video</a> instead.
</video>

Audio:

<audio src="media/08 - Hunter - Milhaven.mp3" controls preload="none">
Your browser doesn't support HTML5 audio. Here is a <a href="media/08 - Hunter - Milhaven.mp3">link to the audio</a> instead.
</audio>

preload="none" should be enough to prevent visitor from auto-downloading those large files when openning your blog, but to make it safer, also to avoid loading video widget everytime when opening the homepage, you can add --- (in Markdown mode) to hide them after "Read more" (Note: after saving the article, before sign and publish, refresh the page one time to make it work).

Edit: Also you need to ASCII-lize your file name or ZeroNet can't sign it, one nice tool is Python unidecode lib:

from unidecode import unidecode
unidecode(song).replace('!',''),  # "!" is not supported in optional file name

Test a video: What is GNU Linux.webm (4.8 MB, not a big file)


Test an audio file: Kismet-_we_are_all_so_busy.mp3 (5.1 MB, it's a big file ;)

Test a video hosted on my 0-Share: [EuroPython 2014] Pieter Hintjens - Our decentralized future (205 MB):

0 Comment:

user_name1 day ago
Reply
Body
Select user
  • Welcome to ZeroMessage!
This page is a snapshot of ZeroNet. Start your own ZeroNet for complete experience. Learn More