Skip to content

Fix video stories shared in DMs showing as still images#249

Open
Pavel12431432 wants to merge 1 commit intomautrix:mainfrom
Pavel12431432:fix-story-video
Open

Fix video stories shared in DMs showing as still images#249
Pavel12431432 wants to merge 1 commit intomautrix:mainfrom
Pavel12431432:fix-story-video

Conversation

@Pavel12431432
Copy link
Copy Markdown

Summary

  • Add handling for a third story URL format in fetchFullXMA where CTA.NativeUrl is a full https://www.instagram.com/stories/username/mediaID?reel_id=... URL. This format was previously unhandled and fell through to the default case, returning only the thumbnail.
  • Uses FetchReel API (with the reel_id from query parameters) to retrieve full story media, matching the approach used by the existing /stories/direct/ handler.
  • Fix MIME type in instagramFetchedMediaToMatrix: when VideoVersions are found in the API response, set MIME to video/mp4 instead of using the XMA preview MIME type (image/jpeg). Without this, video content was sent as image messages.

Test plan

  • Tested with video stories shared via DM — now correctly displays as playable video instead of a still image
  • Verified the fix handles the l.facebook.com/l.php redirect wrapper on CTA.ActionUrl
  • Confirmed existing story handling (type 1 /stories/direct/ and type 2 https://instagram.com/stories/) is unaffected

Add handling for story XMA attachments where CTA.NativeUrl uses the
https://www.instagram.com/stories/ format with reel_id query parameter.
Uses FetchReel API to retrieve the full story media instead of falling
through to the default case which only returned the thumbnail.

Also fix MIME type in instagramFetchedMediaToMatrix: when VideoVersions
are present, set MIME to video/mp4 instead of using the XMA preview
MIME type (image/jpeg), which caused video stories to be sent as image
messages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant