NAME
BeamerReveal::MediaManager - MediaManager
VERSION
version 20260208.1851
SYNOPSIS
Worker object to manage the media files generated for the Reveal HTML presentation. Sometimes the management is just a matter of copying files (videos, images, iframe material) in the media store under a unique ID. Sometimes the file still needs to be generated (TikZ animations). The former operations are cheap. Therefore they are copied at every invocation and stored under a unique ID. The latter are expensive to generate. Therefore they are stored under an ID that is a secure hash value (SHA-standard) based on the source data that is used to generate the animation. This makes sure that whenever the animation does not change in between different runs, we reuse the generated video file. If the source data has changed, we regenerate it.
METHODS
new()
$mm = BeamerReveal::MediaManager->new( $jobname, $base, $presoparams, $id, $debug )
The constructor sets up the manager.
This involves: (a) the directory structure of the filesystemtree in which all objects will be stored; we cal this the "media store", (b) reading the preamble of the original source file, (c) checking whether all the auxiliary tools (your latex compiler, pdfcrop, pdftoppm, ffmpeg) are available.
- .
$jobname -
name of the job that can lead us back to the original LaTeX source file, such that we can read the preamble for reuse in the TikZ animations.
- .
$base -
directory in shiche the media will reside. Typically, this is the base name of the final HTML file, followed by the suffix '_files'.
- .
$presoparams -
parameters of the presentation. This is required to know the compiler and the resolution of the presentation
- .
$debug -
debug flag (undef = off, defined = on) - runs mediamanager in debug mode, i.e. no file cleaning
- .
$mm -
return value: the mediamanager object
revealToStore()
$mm->revealToStore()
Fetches the original reveal support files and copies them into the media store.
backgroundsToStore()
$mm->backgroundsToStore( $bgarray )
Registers the backgrounds into the mediastore.
- .
$bgarrayreference to array containing all backgrounds; in normal format these are just filenames, in embed format, these are Base64-encode ASCII strings.
notesToStore()
$mm->notesToStore( $notearray )
Registers the notes into the mediastore.
- .
$notearrayreference to array containing all notes; in normal format these are just filenames, in embed format, these are Base64-encode ASCII strings.
slideFromStore()
( $mimetype, $string ) = $mm->slideFromStore( $slidenr )
Fetches the media string of slide with number $slidenr. Slides are entered into the store by the Frameconverter. If there is an to_embed key in the %optargs argument, a base64-encoded ASCII string will be returned, else the filename will be returned.
- .
$slidenr -
the slide to fetch
- .
$mimetype -
string describing the mimetype of the file
- .
$string -
If there is an
to_embedkey in the%optargsargument, a base64-encoded ASCII string will be returned, else the filename will be returned.
noteFromStore()
( $mimetype, $string ) = $mm->noteFromStore( $notenr )
Fetches the media string of note with number $notenr. Notes are entered into the store by the NoteFactory. If there is an to_embed key in the %optargs argument, a base64-encoded ASCII string will be returned, else the filename will be returned.
- .
$notenr -
the note to fetch
- .
$mimetype -
string describing the mimetype of the file
- .
$string -
If there is an
to_embedkey in the%optargsargument, a base64-encoded ASCII string will be returned, else the filename will be returned.
animationRegisterInStore()
$path = $mm->animationRegisterInStore( $animation )
Prepare and register the animation in back order such that it can be generated later by processConstructionBackOrders().
- .
$animation -
the $animation object as it was read from the
.rvlfile. - .
$path -
the path of the animation (in the media store)
animationFromStore()
$path = $mm->animationFromStore( $animationid )
Returns the media store path to the animationid.
- .
$animationid -
the $animationod as it was read from the
.rvlfile. - .
$path -
the path of the animation (in the media store)
stillRegisterInStore()
$path = $mm->stillRegisterInStore( $still )
Prepare and register the still in back order such that it can be generated later by processConstructionBackOrders().
- .
$still -
the $still object as it was read from the
.rvlfile. - .
$path -
the path of the still (in the media store)
stillFromStore()
$path = $mm->stillFromStore( $stillfile )
Returns the media store path to the still. If the still is not yet constructed, it will be put in back order, such that it can be generated later by processConstructionBackOrders().
- .
$still -
the $still object as it was read from the
.rvlfile. - .
$path -
the path of the still (in the media store)
processConstructionBackOrders()
$mm->processConnstructionBackOrders( $id )
Generates all animations if they are not cached in the store. The generation is done in parallel using multithreading. If the method fails the temporary files are kept, otherwise they are removed. On MS-Windows there is no working multithreading/multiprocessing.
videoFromStore()
$path = $mm->videoFromStore( $video )
Fetches the unique ID of the $video and returns that ID (the filename of the oject in the media store). The object is put in back-order such that it can be copied later, using processCopyBackOrders.
- .
$video -
the $video file to store in the media store.
- .
$path -
the path to the video (in the media store)
iframeFromStore()
$path = $mm->iframeFromStore( $iframe )
Fetches the unique ID of the $iframe and returns that ID (the filename of the oject in the media store). The object is put in back-order such that it can be copied later, using processCopyBackOrders.
- .
$iframe -
the $iframe file to store in the media store.
- .
$path -
the path to the iframe (in the media store)
audioFromStore()
$path = $mm->audioFromStore( $audio )
Fetches the unique ID of the $audio and returns that ID (the filename of the oject in the media store). The object is put in back-order such that it can be copied later, using processCopyBackOrders.
- .
$audio -
the $audio file to store in the media store.
- .
$path -
the path to the audio (in the media store)
_fromStore()
Helper function; do not use directly.
_rawFromStore()
Helper function; do not use directly.
processCopyBackOrders()
$mm->processCopyBackOrders( $id )
Copies the backordered files from their original location into the store, based on the backorder list.
_animWork()
Worker function; do not use directly.
_stillWork()
Worker function; do not use directly.
AUTHOR
Walter Daems <wdaems@cpan.org>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2025 by Walter Daems.
This is free software, licensed under:
The GNU General Public License, Version 3, June 2007
CONTRIBUTOR
Paul Levrie