Skip to content

Add support for RichMedia annotations - #21474

Merged
calixteman merged 1 commit into
mozilla:masterfrom
calixteman:rich_media
Jun 22, 2026
Merged

calixteman merged 1 commit into
mozilla:masterfrom
calixteman:rich_media

Conversation

@calixteman

Copy link
Copy Markdown
Contributor

Render /Subtype /RichMedia annotations so embedded video and audio can be played in the viewer.

The core layer parses the RichMediaContent dictionary to locate the primary playable asset and its MIME type. The display layer overlays a play button on the annotation's poster; clicking it swaps in a <video>/<audio> element backed by a blob: URL. Presentation mode lets events reach the media controls instead of advancing the page.

It fixes #2787.

@calixteman
calixteman requested a review from timvandermeij June 19, 2026 11:00
@codecov-commenter

codecov-commenter commented Jun 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.97872% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.79%. Comparing base (b646934) to head (d537f5b).

Files with missing lines Patch % Lines
src/core/annotation.js 77.96% 13 Missing ⚠️
src/display/annotation_layer.js 84.93% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21474      +/-   ##
==========================================
- Coverage   89.80%   89.79%   -0.02%     
==========================================
  Files         260      260              
  Lines       66073    66211     +138     
==========================================
+ Hits        59336    59452     +116     
- Misses       6737     6759      +22     
Flag Coverage Δ
browsertest 66.75% <1.49%> (-0.16%) ⬇️
fonttest 9.02% <ø> (ø)
integrationtest 68.94% <75.88%> (+0.03%) ⬆️
unittest 57.17% <34.32%> (-0.05%) ⬇️
unittestcli 56.14% <34.32%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread src/core/annotation.js Resolved
Comment thread src/core/annotation.js Resolved
Comment thread src/core/annotation.js Resolved
Comment thread src/core/annotation.js Resolved

@timvandermeij timvandermeij left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me, with the comment addressed and passing browser tests. Nice work!

Comment thread src/core/annotation.js Resolved
Comment thread src/core/annotation.js Resolved
Render `/Subtype /RichMedia` annotations so embedded video and audio can
be played in the viewer.

The core layer parses the `RichMediaContent` dictionary to locate the
primary playable asset and its MIME type. The display layer overlays a
play button on the annotation's poster; clicking it swaps in a
`<video>`/`<audio>` element backed by a `blob:` URL. Presentation mode
lets events reach the media controls instead of advancing the page.

It fixes mozilla#2787.

This branch was previously deployed

1 inactive deployment
code-coverage — d537f5ba Deployed Jun 22, 2026 by calixteman via windows-latest / firefox #693
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Videos in PDF.js

5 participants