MobMedia.DemoScreen (mob_media v0.1.0)

Copy Markdown View Source

A ready-to-run sample screen exercising MobMedia, shipped so a generated app can try the plugin the moment it's activated. Declared in the plugin manifest's :screens (route /mob_media/demo). Delete it (and the manifest entry) in a real app.

Pick a file opens the system picker for audio or video; Sample tone writes a one-second WAV. Either way the screen shows the file's info, the length of its audio decoded to 16 kHz mono PCM (beside the duration, so a mismatch is visible), and for a video the frame at one second.

The work runs in a task: MobMedia's functions block their caller until the answer is ready, and a screen that blocks stops answering taps.

Summary

Functions

dump_state(assigns)

Callback implementation for Mob.Screen.dump_state/1.

handle_event(event, params, socket)

Callback implementation for Mob.Screen.handle_event/3.

load_state(vsn, stored)

Callback implementation for Mob.Screen.load_state/2.

terminate(reason, socket)

Callback implementation for Mob.Screen.terminate/2.