Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support the new media processing #1707

Open
wants to merge 55 commits into
base: stable
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
71ad5f5
Update attachments over realtime and during drafts setup
davidmz Jan 25, 2025
5a92704
Add "processing..." text for files in progress
davidmz Jan 25, 2025
c3f4222
Detect video file by URL extension
davidmz Jan 25, 2025
a665c5a
Update test snapshot
davidmz Jan 25, 2025
3cdd44d
Fetch draft attachments details from the server
davidmz Jan 25, 2025
6d963ae
Use new API for image attachments
davidmz Jan 26, 2025
d818a4c
Use new API for audio and general attachments
davidmz Jan 26, 2025
6e5f96f
Show video attachments as video
davidmz Jan 26, 2025
8cc5f93
Fully rewrite object in store in mergeByIds helper
davidmz Jan 28, 2025
87ca1c3
Fix links to the 'general' attachments
davidmz Jan 31, 2025
4cfd845
Create a new new inline photogallery
davidmz Feb 1, 2025
16db909
Show animated images as a looped video without controls
davidmz Feb 4, 2025
a140d1e
Improve inline lightbox layout
davidmz Feb 4, 2025
dc20d18
Fix lightbox opening animation for video
davidmz Feb 4, 2025
cc759e3
Show short silent videos as 'gifs' (i.e. looped and without controls)
davidmz Feb 4, 2025
1895634
Adjust the display of small or thin/tall images
davidmz Feb 4, 2025
b21fa1e
Fix default NSFW canvas color
davidmz Feb 5, 2025
0a6b45d
Update the previews stretching algorithm
davidmz Feb 5, 2025
1a5c12f
Handle the first render of gallery case
davidmz Feb 5, 2025
3cd1cd2
Adjust the single image sizes
davidmz Feb 5, 2025
e11e742
Show in-progress videos as a visual attachments
davidmz Feb 5, 2025
efc75c1
Don't handle images without sizes
davidmz Feb 5, 2025
b592f7d
Add dark mode attachments style
davidmz Feb 5, 2025
3a63e67
Replace VisualContainer by two components: for display and for editing
davidmz Feb 5, 2025
b941f53
Break long links
davidmz Feb 6, 2025
094de6d
Add fold/unfold functionality to post attachments
davidmz Feb 6, 2025
332a934
Move visual attachment code to the separate folder
davidmz Feb 6, 2025
f5428e6
Add attachments count to the button title
davidmz Feb 6, 2025
f552648
Update tests
davidmz Feb 6, 2025
61e7490
Show like-a-video attachments
davidmz Feb 6, 2025
b25571a
Remove old attachment components
davidmz Feb 6, 2025
874cfeb
Disable PiP for videos
davidmz Feb 6, 2025
f6185dc
Handle images without explicit sizes
davidmz Feb 6, 2025
286c8ce
Prevent disconnected video from playing after leaving PIP
davidmz Feb 7, 2025
b93b2b1
Allow to post images/videos to comments and show them in lightbox
davidmz Feb 7, 2025
04250f8
Rewrite the mediaOpener/MediaLink functionaity
davidmz Feb 8, 2025
a820451
Use handleLeftClick helper
davidmz Feb 8, 2025
e030eb5
Update MediaLink functionality
davidmz Feb 9, 2025
96b578e
Fix Youtube and Vimeo play/pause functionality
davidmz Feb 9, 2025
ff5b288
Define attachments domains in config
davidmz Feb 9, 2025
6d17f86
Correct size of small single image
davidmz Feb 10, 2025
2694b3b
Remove special click handling on general attachment link
davidmz Feb 10, 2025
c3f71e1
Disable page scrolling when lightbox is opened
davidmz Feb 14, 2025
e76cb67
Play/pause the current video by Space key
davidmz Feb 14, 2025
bac6944
Use accurate device pixel ratio in visual previews
davidmz Feb 15, 2025
d0288cb
Use cleaner way to prevent scrolling when the lightbox is on
davidmz Feb 15, 2025
34690dc
Scroll page to keep att. container visible after its fold
davidmz Feb 15, 2025
82a4866
Show the current upload speed
davidmz Feb 15, 2025
f806e40
Don't play video on hover on non-hoverable devices
davidmz Feb 15, 2025
6cccb1a
Fix a bug when deleting a post draft left image previews
davidmz Feb 16, 2025
0ecfe3c
Allow to abort the unfinished file upload
davidmz Feb 17, 2025
77472da
Replace noImageAttachments by noVisualAttachments
davidmz Feb 17, 2025
8b11941
Update single image size calculations
davidmz Feb 18, 2025
46e5f3a
Move fold preview out of image in non-stretched rows
davidmz Feb 18, 2025
d82766f
Increase maxPreviewAspectRatio
davidmz Feb 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Detect video file by URL extension
  • Loading branch information
davidmz committed Jan 25, 2025

Verified

This commit was signed with the committer’s verified signature.
calcastor BT (calcastor/mame)
commit c3f4222210e85ef92f9a8b51178cbab059baea27
6 changes: 6 additions & 0 deletions src/components/post/post-attachments.jsx
Original file line number Diff line number Diff line change
@@ -22,6 +22,12 @@ const supportedVideoTypes = Object.entries(videoTypes)
video = null;

const looksLikeAVideoFile = (attachment) => {
if (attachment.inProgress) {
return false;
}
if (attachment.url.endsWith('.mp4')) {
return true;
}
const lowercaseFileName = attachment.fileName.toLowerCase();

for (const extension of supportedVideoTypes) {