Skip to content

Videos in PDF.js #2787

Closed
Closed

Description

@count0

Are there any plans to include support for embedded videos in PDF files?

This is currently unsupported in any other PDF viewers in GNU/Linux, so it would be a significant contribution.

Activity

  1. yurydelendik commented on Feb 23, 2013

    @yurydelendik
    Contributor

    13.2.4 Media Clip Objects from PDF32000:2008? If codec is supported by browser, then it will be possible. Could you post link(s) to the existing PDF(s) with embedded videos?

  2. saebekassebil commented on Apr 7, 2013

    @saebekassebil
    Contributor

    There's no video showing in both Preview and the Chrome PDF Viewer.

  3. count0 commented on Apr 7, 2013

    @count0
    Author

    AFAIK video support only works with Acrobat Reader in windows, perhaps also in MacOS but I'm not sure.

  4. happyalu commented on May 18, 2013

    @happyalu

    The latest okular on Linux (with the help of libpoppler) also displays the embedded files properly. It would be great to have this support for audio/video in codecs supported by the browser.

  5. gigaherz commented on May 18, 2013

    @gigaherz
    Contributor

    Is this even used by anyone? I suppose so, since there's people showing interest, but it sounds like the kind of feature that only serves as an excuse to sell you a newer version of Acrobat, but no one really needs.

    I guess the developers will not give this any priority, unless there's proof that more than a handful of people use it in real life. So if someone really wants to see this implemented, the fastest way would be to implement it yourselves, and make a Pull Request. But like Yury said, unless the embedded media happens to be supported by the browser, I don't see it happening.

  6. happyalu commented on May 18, 2013

    @happyalu

    I often make presentations with latex/beamer with the movie15 package that creates these PDF files. So to me this would be a very nice feature to have. I don't really use acrobat after libpoppler supports it now though :)

  7. count0 commented on May 18, 2013

    @count0
    Author

    Yes, I agree with happyalu. Embedded videos in presentations is also what I had in mind. I do think it would be a very useful feature.

  8. Lekensteyn commented on Sep 9, 2013

    @Lekensteyn

    Our lecturer gives us a PDF presentation which contains embedded video, but Okular does not support this. The PDF was created with Adobe PDFMaker 10.1 for PowerPoint.
    According to https://bugs.kde.org/show_bug.cgi?id=311457 (not my bug/file), Adobe embeds Flash (!!) in the PDF.

  9. benbro commented on Jan 2, 2014

    @benbro
    Contributor

    I've uncompressed the example in #2787 (comment)
    pdftk overlay-example.pdf output doc.unc.pdf uncompress
    http://pastebin.com/M7CSvg0Q

    I've added a console message

    console.log(subtype, ref);
    

    https://github.com/mozilla/pdf.js/blob/master/src/shared/annotation.js#L253
    And got from the first page:

    FileAttachment Object { num=15, gen=0}
    Screen Object { num=16, gen=0}
    

    Does it means that the first annotation is the actual video data and the second annotation displays it?
    How can I get the video binary data and insert it in a video tag?
    How can I place the video tag in the right position?

  10. yurydelendik commented on Feb 26, 2014

    @yurydelendik
    Contributor

    Screen has something:

    • dict.get('A').get('R').get('C').get('D').get('EF').get('F') is a binary stream
    • or, dict.get('A').get('R').get('C').get('D').get('F') is a url
  11. fbender commented on Nov 16, 2015

    @fbender

    Fixed by #5450

  12. timvandermeij commented on Sep 11, 2016

    @timvandermeij
    Collaborator

    Previous work for this has been done in #4376, which continued in #5450, but both were closed because the solution was not complete. Anyone willing to work on this feature may create a new pull request and perhaps reuse parts of those pull requests.

    I recommend to first work on the core layer in src/core/annotation.js: create a new class for video annotations and parse the data to prepare it for the display layer. Make sure that this works as expected and provide unit tests. Then, a second pull request could implement video annotations in the display layer in src/display/annotation_layer.js, which actually makes the annotations appear on the rendered document. Doing it this way, in small chunks, makes implementation, testing and review easier than if it were done in one big pull request.

    In my opinion this should work with the HTML5 <video> tag as much as possible.

  13. AliSubhan commented on May 16, 2018

    @AliSubhan

    can anyone help me with the architecture of PDF.js . I'm working on project so if anyone can help me with the architecture of this project. it will be nice of you.

  14. Guillaume-Garrigos commented on Jun 12, 2026

    @Guillaume-Garrigos

    Just coming by to say that such feature (playing any kind of video / gif on a pdf) is one of the reasons why a lot of academics keep using Adobe (we often want / need to show dynamic experiments in our classes / research talks).

  15. self-assigned this
    on Jun 12, 2026
  16. added 3 commits that reference this issue on Jun 19, 2026
    9550130
    4c0cc1b
    d537f5b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions