Directory macros/latex/contrib/media9nf
media9nf
Version 0.2.1, 2026-12-05
media9nf embeds video and audio in PDF files using the same commands as media9: \includemedia, \addmediapath and \mediabutton, but without Flash.
media9 plays video and audio through Flash players (VPlayer.swf, APlayer.swf). Adobe ended Flash in December 2020, and current versions of Acrobat Reader no longer play that content. media9nf embeds the media file itself as a RichMedia annotation, and the PDF viewer plays it with its own player.
Usage
\usepackage{media9nf} ... \includemedia[ width=0.85\textwidth, activate=onclick, deactivate=pageinvisible ]{\includegraphics{media9nf-poster.png}}{media9nf-sample.mp4}
Existing media9 documents should work after changing \usepackage{media9} to \usepackage{media9nf}. Calls that name a Flash player (VPlayer.swf and similar) embed the media file the player would have loaded instead.
The manual, media9nf-doc.pdf, lists all options and explains the differences from media9.
Requirements
A LaTeX format from 2023-11-01 or later, and the pdfbase package, which comes with media9. Works with pdfLaTeX, LuaLaTeX, XeLaTeX, and LaTeX with dvipdfmx or with dvips and Ghostscript.
Viewer support
Playback depends on the viewer. RichMedia annotations are supported by Adobe Acrobat and Acrobat Reader, and by KDE Okular. Okular plays video but not audio (.mp3, .wav, .ogg, .aac) unless you use the audioasvideo option. Browser PDF viewers, macOS Preview and SumatraPDF show the poster image but do not play the media. Test your PDF in the viewer your audience will use.
Files
| File | Purpose |
|---|---|
media9nf.sty |
the package |
CHANGELOG.md |
changes in each version |
media9nf-doc.tex, media9nf-doc.pdf |
the manual |
media9nf-example-article.tex |
article with an embedded video |
media9nf-example-beamer.tex |
beamer slide with an embedded video |
media9nf-sample.mp4, media9nf-poster.png |
test clip and poster used by the manual and examples |
build.sh |
builds the manual and the CTAN zip (not part of the CTAN upload) |
Installation
media9nf is on CTAN: https://ctan.org/pkg/media9nf. In TeX Live and MiKTeX, install it with the package manager (tlmgr install media9nf in TeX Live).
To install by hand, put media9nf.sty where TeX finds it, for example TEXMFHOME/tex/latex/media9nf/.
Security
\includemedia adds no JavaScript or document actions; only \mediabutton uses JavaScript. Media given as a URL is fetched by the viewer when it is activated. File names, labels and other option values are escaped before they go into the PDF. See the Security section of the manual.
Bugs and source
https://github.com/gpena/media9nf
License
Copyright (C) 2026 Gonçalo Pena
This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c of this license or (at your option) any later version. The latest version of this license is at https://www.latex-project.org/lppl.txt.
This work has the LPPL maintenance status maintained. The Current Maintainer of this work is Gonçalo Pena.
The sample clip and poster were generated with FFmpeg's testsrc2 and sine test sources and are covered by the same license.
Download the contents of this package in one zip archive (979.8k).
Media9nf – Embed video and audio in PDF with the media9 interface, without Flash
media9nf provides the \includemedia, \addmediapath and \mediabutton commands of the media9 package without using Flash.
media9 plays video and sound through embedded Flash players, which current versions of Adobe Acrobat and Acrobat Reader no longer run. media9nf embeds the media file itself (for example H.264 MP4 or MP3) as a RichMedia annotation that the viewer plays with its own player. Most media9 documents compile unchanged after replacing the package name; calls that name a media9 Flash player embed the media file that player would have loaded. Embedded files carry their MIME type and size, and the audioasvideo option writes audio so that Okular, which only plays video annotations, plays it too.
The package works with pdfLaTeX, LuaLaTeX, XeLaTeX, dvipdfmx and dvips with Ghostscript, and needs LaTeX 2023-11-01 or later. Playback needs a viewer with RichMedia support, such as Adobe Acrobat Reader or Okular.
| Package | Media9nf |
| Bug tracker | |
| Repository | |
| Version | 0.2.1 2026-12-05 |
| Licenses | The LaTeX Project Public License 1.3c |
| Copyright | 2026 Gonçalo Pena |
| Maintainer | Gonçalo Pena |
| Contained in | TeX Live as media9nf |
| Topics | PDF features Multimedia |