Demo Scene
Demo/ProperVideoPlayerMasterDemo.unity contains five focused examples of the
runtime API. A WebGL build of the same scene is available in the
interactive demo.
Installation#
Open Tools → Proper Video Player → Setup and select Install Demos. This imports the
scene, demo scripts, shaders, materials, and sample media under
Assets/StreamingAssets/ProperVideoPlayerWebGL.
Remove Demos deletes the imported Demo folder and its sample media. Runtime files are not
removed.
Scenarios#
MasterDemoController switches between scenarios by enabling one root object at a time. Each demo
player enables Pause When Disabled, so an inactive scenario pauses decoding and frame uploads and resumes
when re-enabled.
Player#
Demonstrates a complete transport interface: play and pause, mute and volume, seeking, buffered-ahead visualization, playback-rate selection, and a diagnostics panel. The panel reports video resolution and frame rate, decoded and dropped frames, buffer duration, ready and network states, upload path and timing, and watchdog recoveries.
Source controls cover a bundled file, a remote progressive file, HLS, DASH, and a custom URL. The custom URL field uses the included WebGL clipboard bridge.
Multi-Player#
Runs four independent players in a 2×2 grid and displays per-player timing, dimensions, presented-frame counts, and watchdog recovery counts. Each player has its own output texture. See Multiple Players for resource and texture requirements.
Shader FX#
Applies the included effect shaders to a video RawImage and exposes their material properties with
sliders. Lens, RippleTouch, and Spotlight receive pointer input from MouseFXDriver. Materials are
instantiated at runtime so the shared assets remain unchanged. See Shader Effects.
3D Object#
Assigns CurrentTexture to materials on selectable 3D geometry, then renders the scene through a
secondary camera into the UI. The controller adjusts texture scale and offset when
RequiresVerticalFlip is true and implements drag rotation with idle rotation.
Token Auth#
Configures a request header and credentialed CORS before opening a URL. The example also reports source-type and platform restrictions for progressive media, HLS, DASH, and the fallback backend. See Token-Authenticated Streams.
Key demo scripts#
| Script | Purpose |
|---|---|
PlayerBarController | Implements source selection, transport controls, buffered-ahead display, playback-rate controls, and runtime diagnostics through the public player API. |
SeekSliderGrab | Tracks slider drag state and emits the selected normalized value when the pointer is released. |
MasterDemoController | Switches scenario roots and updates tab selection state. |
MultiPlayerDemoController | Aggregates status and watchdog-recovery data from multiple independent players. |
ShaderFXDemoController | Creates per-instance effect materials, maps sliders to shader properties, and activates mouse input for interactive effects. |
MouseFXDriver | Converts pointer coordinates to video UV space and supplies time and click-ripple data to interactive materials. |
ObjectDemo3DController | Applies the video texture to 3D renderers, handles vertical orientation, selects geometry, and implements drag and idle rotation. |
TokenAuthDemoController | Applies request headers and cookie credentials and displays relevant platform limitations. |
WebGLPasteSupport | Forwards browser paste input to the focused legacy InputField in WebGL builds. It has no effect on other platforms. |
DemoTheme | Defines the shared color palette used by the demo controllers. |
Building the demo#
Add Demo/ProperVideoPlayerMasterDemo.unity to the project's scene list and create a standard
WebGL build. Files under StreamingAssets are included automatically.