now publish m3u8 hls & videojs.html INDEX

This commit is contained in:
fred 2022-03-31 22:30:18 +02:00
parent 72dccb1adf
commit d577f8b2ea
8 changed files with 23429 additions and 7 deletions

26
templates/js/video.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
<title>_PSEUDO_ VIDEO BUNKER - Astroport powered</title>
<link rel="stylesheet" href="_IPFSROOT_/styles/decoration.css" type="text/css" />
<link rel="stylesheet" href="_IPFSROOT_/styles/layout.css" type="text/css" />
<link rel="icon" type="image/png" href="/ipfs/_IPFSROOT_/styles/logo.png" />
<link rel="icon" type="image/png" href="_IPFSROOT_/styles/logo.png" />
</head>
<body>

47
templates/videojs.html Normal file
View File

@ -0,0 +1,47 @@
<!DOCTYPE html>
<html>
<head>
<title>_PSEUDO_ [IPFS Bunker BOX]</title>
<link rel="stylesheet" href="_IPFSROOT_/styles/video-js.css" type="text/css" />
<link rel="stylesheet" href="_IPFSROOT_/styles/decoration.css" type="text/css" />
<link rel="stylesheet" href="_IPFSROOT_/styles/layout.css" type="text/css" />
<link rel="icon" type="image/png" href="_IPFSROOT_/styles/logo.png" />
</head>
<body>
<header>
<h6>
<a href="https://astroport.com">Bunker "<span>BOX</span>"</a> _PSEUDO_
</h6>
</header>
<main>
<article>
<video
id="my-video"
class="video-js"
controls
preload="auto"
width="640"
height="360"
poster="MY_VIDEO_POSTER.jpg"
data-setup="{}"
>
<source src="_HLS_" type="application/x-mpegURL" />
<p class="vjs-no-js">
Activer JavaScript
</p>
</video>
</article>
</main>
</body>
<!-- Put these JS files together with this HTML file -->
<script src="_IPFSROOT_/js/video.min.js"></script>
<script src="_IPFSROOT_/js/videojs-contrib-hls.js"></script>
<script>
var player = videojs('my-video');
player.play();
</script>
</html>

View File

@ -111,16 +111,22 @@ $IPFSNGW/ipfs/$IPFSVIDM3U8/$VIDEOSRC.m3u8
##########################################################################
echo ">>>>>>>>>>>>>>>> JOIN MP4 & PUBLISH INDEX"
echo "ffmpeg -i /tmp/$VUID/media/$VIDEOSRC -i /tmp/$VUID/media/$AUDIOFILE -shortest /tmp/$VUID/media/output.mp4"
[[ ! -f /tmp/$VUID/media/output.mp4 ]] && ffmpeg -i /tmp/$VUID/media/$VIDEOSRC -i /tmp/$VUID/media/$AUDIOFILE -shortest /tmp/$VUID/media/output.mp4
IPFSID=$(ipfs add -wrHq /tmp/$VUID/media/output.mp4 | tail -n 1)
# CONVERT TO MP4
# echo "ffmpeg -i /tmp/$VUID/media/$VIDEOSRC -i /tmp/$VUID/media/$AUDIOFILE -shortest /tmp/$VUID/media/output.mp4"
# [[ ! -f /tmp/$VUID/media/output.mp4 ]] && ffmpeg -i /tmp/$VUID/media/$VIDEOSRC -i /tmp/$VUID/media/$AUDIOFILE -shortest /tmp/$VUID/media/output.mp4
# IPFSID=$(ipfs add -wrHq /tmp/$VUID/media/output.mp4 | tail -n 1)
mkdir -p /tmp/$VUID/public
sed "s/_IPFSID_/$IPFSGWESC\/ipfs\/$IPFSID/g" ${MY_PATH}/../templates/video_bunker.html > /tmp/$VUID/public/index.html
sed -i s/_DATE_/$(date -u "+%Y-%m-%d#%H:%M:%S")/g /tmp/$VUID/public/index.html
sed -i "s/_PSEUDO_/$(hostname)/g" /tmp/$VUID/public/index.html
# sed "s/_IPFSID_/$IPFSGWESC\/ipfs\/$IPFSID/g" ${MY_PATH}/../templates/video_bunker.html > /tmp/$VUID/public/index.html
sed "s-_HLS_-$VMAIN-g" ${MY_PATH}/../templates/videojs.html > /tmp/$VUID/public/index.html
sed -i s/_DATE_/$(date -u "+%Y-%m-%d#%H:%M:%S")/g /tmp/$VUID/public/index.html
sed -i "s/_PSEUDO_/$TITLE/g" /tmp/$VUID/public/index.html
# COPY style AND js
cp -R ${MY_PATH}/../templates/styles /tmp/$VUID/public/
cp -R ${MY_PATH}/../templates/js /tmp/$VUID/public/
echo "ipfs add -rH /tmp/$VUID/public/* "
IPFSROOT=$(ipfs add -rwHq /tmp/$VUID/public/* | tail -n 1)
# Change CSS path to

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB