From 344ba53acd4a5fd4bdaed15e0c97dd3ed4cfb377 Mon Sep 17 00:00:00 2001 From: celestora Date: Sat, 28 Jan 2023 22:25:00 +0200 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D1=88=D0=BD=D0=BE=D0=B9=20?= =?UTF-8?q?=D0=BC=D1=8F=D1=81=D0=BD=D0=BE=D0=B9=20=D0=BF=D0=BB=D0=B5=D0=B5?= =?UTF-8?q?=D1=80=20(#839)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add video title under post attachment box * Add VK-styled player * bideoplayer on video page now sosiski * Fix context menu display on Chrome * Videos now use H.264 instead of Theora hazbin hotel nude mo а вообще тут мог бы быть AV1, но пидорасы из купертино фанаты libx264 --- Web/Models/Entities/Video.php | 2 +- Web/Models/shell/processVideo.ps1 | 2 +- Web/Models/shell/processVideo.sh | 2 +- Web/Presenters/templates/@layout.xml | 3 + Web/Presenters/templates/Videos/View.xml | 4 +- Web/Presenters/templates/_includeCSS.xml | 5 +- .../templates/components/attachment.xml | 8 +- Web/static/css/bsdn.css | 213 ++++++++++++ Web/static/css/style.css | 18 + Web/static/img/bsdn/fullscreen.gif | Bin 0 -> 333 bytes Web/static/img/bsdn/pause.gif | Bin 0 -> 248 bytes Web/static/img/bsdn/play.png | Bin 0 -> 3806 bytes Web/static/img/bsdn/speaker.gif | Bin 0 -> 240 bytes Web/static/img/bsdn/speaker_muted.gif | Bin 0 -> 88 bytes Web/static/img/videoico.png | Bin 0 -> 130 bytes Web/static/js/player.js | 324 ++++++++++++++++++ 16 files changed, 575 insertions(+), 6 deletions(-) create mode 100644 Web/static/css/bsdn.css create mode 100644 Web/static/img/bsdn/fullscreen.gif create mode 100644 Web/static/img/bsdn/pause.gif create mode 100644 Web/static/img/bsdn/play.png create mode 100644 Web/static/img/bsdn/speaker.gif create mode 100644 Web/static/img/bsdn/speaker_muted.gif create mode 100644 Web/static/img/videoico.png create mode 100644 Web/static/js/player.js diff --git a/Web/Models/Entities/Video.php b/Web/Models/Entities/Video.php index f1f07d8f..1b5110e5 100644 --- a/Web/Models/Entities/Video.php +++ b/Web/Models/Entities/Video.php @@ -13,7 +13,7 @@ class Video extends Media const TYPE_EMBED = 1; protected $tableName = "videos"; - protected $fileExtension = "ogv"; + protected $fileExtension = "mp4"; protected $processingPlaceholder = "video/rendering"; diff --git a/Web/Models/shell/processVideo.ps1 b/Web/Models/shell/processVideo.ps1 index 254f619d..eddc9d6e 100644 --- a/Web/Models/shell/processVideo.ps1 +++ b/Web/Models/shell/processVideo.ps1 @@ -13,7 +13,7 @@ Move-Item $file $temp # video stub logic was implicitly deprecated, so we start processing at once ffmpeg -i $temp -ss 00:00:01.000 -vframes 1 "$dir$hashT/$hash.gif" -ffmpeg -i $temp -c:v libtheora -q:v 7 -c:a libvorbis -q:a 4 -vf "scale=640:480:force_original_aspect_ratio=decrease,pad=640:480:(ow-iw)/2:(oh-ih)/2,setsar=1" -y $temp2 +ffmpeg -i $temp -c:v libx264 -q:v 7 -c:a libmp3lame -q:a 4 -tune zerolatency -vf "scale=640:480:force_original_aspect_ratio=decrease,pad=640:480:(ow-iw)/2:(oh-ih)/2,setsar=1" -y $temp2 Move-Item $temp2 "$dir$hashT/$hash.ogv" Remove-Item $temp diff --git a/Web/Models/shell/processVideo.sh b/Web/Models/shell/processVideo.sh index f5542c63..749dd070 100644 --- a/Web/Models/shell/processVideo.sh +++ b/Web/Models/shell/processVideo.sh @@ -5,7 +5,7 @@ cp ../files/video/rendering.apng $3${4:0:2}/$4.gif cp ../files/video/rendering.ogv $3/${4:0:2}/$4.ogv nice ffmpeg -i "/tmp/vid_$tmpfile.bin" -ss 00:00:01.000 -vframes 1 $3${4:0:2}/$4.gif -nice -n 20 ffmpeg -i "/tmp/vid_$tmpfile.bin" -c:v libtheora -q:v 7 -c:a libvorbis -q:a 4 -vf "scale=640:480:force_original_aspect_ratio=decrease,pad=640:480:(ow-iw)/2:(oh-ih)/2,setsar=1" -y "/tmp/ffmOi$tmpfile.ogv" +nice -n 20 ffmpeg -i "/tmp/vid_$tmpfile.bin" -c:v libx264 -q:v 7 -c:a libmp3lame -q:a 4 -tune zerolatency -vf "scale=640:480:force_original_aspect_ratio=decrease,pad=640:480:(ow-iw)/2:(oh-ih)/2,setsar=1" -y "/tmp/ffmOi$tmpfile.mp4" rm -rf $3${4:0:2}/$4.ogv mv "/tmp/ffmOi$tmpfile.ogv" $3${4:0:2}/$4.ogv diff --git a/Web/Presenters/templates/@layout.xml b/Web/Presenters/templates/@layout.xml index 490225b6..bb0d172e 100644 --- a/Web/Presenters/templates/@layout.xml +++ b/Web/Presenters/templates/@layout.xml @@ -294,6 +294,7 @@ {script "js/messagebox.js"} {script "js/notifications.js"} {script "js/scroll.js"} + {script "js/player.js"} {script "js/al_wall.js"} {script "js/al_api.js"} {script "js/al_mentions.js"} @@ -310,6 +311,8 @@ {/if} + +