NAME

BeamerReveal::MediaManager - MediaManager

VERSION

version 20251224.1500

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, $config, $presoparams )

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'.

. $config

configuration object that can be queried for settings. At this moment this is not very heavily used.

. $presoparams

parameters of the presentation. This is required to know the compiler and the resolution of the presentation

. $mm

mediamanager object that can be used to manage the media of the presentation.

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 have been entered into the store by the Frameconverter.

. $slide

the slide to fetch

. $path

the path of the slide (in the media store)

animationToStore()

$path = $mm->animationToStore( $animation )

Generates the animation with content $animation in the media store and returns the media store path to the animation. The generation is done in parallel using multithreading. If the method fails the temporary files are kept, otherwise they are removed.

. $animation

the $animation object as it was read from the .rvl file.

. $path

the path of the animation (in the media store)

imageToStore()

$path = $mm->imageToStore( $image )

Copies the $image to the store under a unique ID and returns that ID (the filename of the oject in the media store).

. $image

the $image file to store in the media store.

. $path

the path to the image (in the media store)

videoToStore()

$path = $mm->videoToStore( $video )

Copies the $video to the store under a unique ID and returns that ID (the filename of the oject in the media store).

. $video

the $video file to store in the media store.

. $path

the path to the video (in the media store)

iframeToStore()

$path = $mm->iframeToStore( $iframe )

Copies the $iframe to the store under a unique ID and returns that ID (the filename of the oject in the media store).

. $iframe

the $iframe file to store in the media store.

. $path

the path to the iframe (in the media store)

audioToStore()

$path = $mm->audioToStore( $audio )

Copies the $audio to the store under a unique ID and returns that ID (the filename of the oject in the media store).

. $audio

the $audio file to store in the media store.

. $path

the path to the audio (in the media store)

_toStore()

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