diff --git a/layouts/shortcodes/webtorrent-video.html b/layouts/shortcodes/webtorrent-video.html index 3a0f888..8d1b80c 100644 --- a/layouts/shortcodes/webtorrent-video.html +++ b/layouts/shortcodes/webtorrent-video.html @@ -1,16 +1,37 @@ +<style> + #wtmedia{ + width:100%; + } + #wtmedia video{ + width:100%; + } +</style> <script src="/webtorrent.js"></script> -<div id="wtmedia"> +<div class="webtorrent"> + <noscript> + <video controls> + <source src={{.Get "source"}}> + </video> + </noscript> + <div id="wtmedia"> + </div> + <div> + Peers:<span id="Peers"></span> + </div> </div> <script> - const client = new WebTorrent(tracker=false,dht=true,webSeeds=true); - const magnetURI = '{{.Get 0}}'; + const client = new WebTorrent(); + const magnetURI = {{.Get "magnet"}}; client.add(magnetURI, function (torrent) { // Got torrent metadata! - console.log('Client is downloading:', torrent.infoHash) + torrent.addWebSeed({{.Get "source"}}); + console.log('Client is downloading:', torrent.infoHash); torrent.files.forEach(function (file) { // Display the file by appending it to the DOM. Supports video, audio, images, and // more. Specify a container element (CSS selector or reference to DOM node). - file.appendTo('#wtmedia') + file.appendTo('#wtmedia'); }) - }) -</script> + }); + function updateData(torrent); + window.setInterval() +</script> \ No newline at end of file diff --git a/static/css/theme.css b/static/css/theme.css index c4e5497..6fde21d 100644 --- a/static/css/theme.css +++ b/static/css/theme.css @@ -151,7 +151,9 @@ article ul, article ol, article table{ text-align: left; - width:90%; +} +article p{ + width:100%; } article img{ diff --git a/static/res/digital-bg2.webp b/static/res/digital-bg2.webp new file mode 100644 index 0000000..9d9ce36 Binary files /dev/null and b/static/res/digital-bg2.webp differ