NAME
BeamerReveal::MediaManager - MediaManager
VERSION
version 20260111.1557
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 )
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
- .
$mm -
return value: the mediamanager object
revealToStore()
$mm->revealToStore()
Fetches the original reveal support files and copies them into the media store.
slideFromStore()
$path = $mm->slideFromStore( $slide )
Fetches the media store pathname of $slide. Slides are entered into the store by the Frameconverter.
animationFromStore()
$path = $mm->animationFromStore( $animation )
Returns the media store path to the animation. If the animation is not yet constructed, it will be put 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)
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.
imageFromStore()
$path = $mm->imageFromStore( $image )
Fetches the unique ID of the $image 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.
- .
$image -
the $image file to store in the media store.
- .
$path -
the path to the image (in the media store)
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.
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.
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