Search the site
APP
Players, recorders, 3D scenes and spatial windows share one rule: their state moves only when the device confirms it.
Add dartvel_scene and enable scene3d to render scenes through Flutter Scene. Browser rendering is verified; native rendering depends on Flutter GPU support. Most targets have no native player or headset binding yet, and each section says which.
ON THIS PAGE
Play audio and video, and record
Show the camera, take photos and record
Describe a 3D scene
Open a window in space
DVBox.video and DVBox.audio own their player while they are on screen, and release it when the page closes.
A player is not playing until the device says so, and a recording cut short by the app going to the background ends as interrupted, with the partial file kept.
Protected content with no DRM adapter is refused up front, never played broken.
Captions are WebVTT or SubRip files, shown as real text over the picture, so a screen reader reads them and Ctrl+F finds them.
The built-in controls are labelled buttons in Tab order; a focused player answers k or space, j, l, m and c.
A session puts the player on the lock screen, and its buttons drive the same player.
Remote files are read through a disk cache, and precache fetches the start of a video before anyone presses play.
// Playback is a mode of the box, so the box keeps its size, modifiers,
// gestures and semantics, and the source says what is played.
// The box's element owns the player, so leaving the page releases the
// decoder and the audio focus with it.
Widget trailer() => DVBox.video(
const DVMediaSource.url('https://cdn.example.com/trailer.mp4'),
captions: DVCaptions.track(
'en',
const DVMediaSource.url('https://cdn.example.com/trailer.en.vtt'),
),
session: const DVMediaSession(title: 'Launch trailer'),
).modifier(const DVModifier().width(640));Copy code to clipboard
// The first megabyte is on disk before the page that plays it opens.
Future<bool> warmTrailer() => DV.Platform.media.precache(
const DVMediaSource.url('https://cdn.example.com/trailer.mp4'),
bytes: 1024 * 1024,
);Copy code to clipboard
Partial
Spec section: Media Playback and Capture
Planned work and implementation limits
Linux plays through GStreamer, and only the audio: video frames are not drawn yet. Linux has no lock-screen controls or camera yet.
The browser player and camera are written but not yet checked in a real browser.
No player or camera backend yet for Android, iOS, macOS, Windows or TVs.
No casting.
DVBox.camera opens the camera while it is on screen, closes it when the page closes or the app goes to the background, and opens it again when the app comes back.
It is not ready until the device says so; a refused permission is a typed error, never an empty picture.
Photos and clips are written where only your app can read them, and a clip is the same recording session recordVideo gives.
Widget scanner(void Function(DVFile photo) keep) =>
DVBox.camera(lens: .back, onPhoto: keep);Copy code to clipboard
flutter pub add dartvel_scene
dartvel build webCopy code to clipboard
# pubspec.yaml
dartvel:
scene3d:
enabled: trueCopy code to clipboard
Enable scene3d before building. Dartvel installs the renderer and switches Flutter GPU on for native builds automatically.
A scene is a document of nodes, cameras and glTF assets with stated units and axes, and it round-trips exactly.
Tapping picks the node under the finger by its real shape.
Assets must come from your own storage or listed hosts, with a digest that is checked before use.
Set dartvel.scene3d.enabled: true and add dartvel_scene: scenes then render through Flutter Scene, on Flutter GPU natively and WebGL2 in the browser, and the build switches Flutter GPU on for each platform for you.
Boxes, spheres and planes take small JSON materials (base colour, metal, roughness, glow); glTF models load as they are.
Where a device has no GPU support, the scene shows its poster and says why. It never shows a hole.
// A scene is a list of nodes, so what is in it is data a page builds rather
// than a sequence of calls into a renderer. The viewport reports how it had
// to degrade instead of quietly drawing less.
Widget mug(DVSceneAsset model) => DVBox.scene(
DVScene(
label: 'A stoneware mug, turning',
nodes: <DVSceneNode>[
DVModel3D(model).id('mug'),
DVSceneCamera.orbit(distance: 2.5, controls: true),
DVLight.directional(direction: const DVVec3(-1, -2, -1)).shadows(),
],
),
);Copy code to clipboard
Partial
Spec section: 3D Scenes
Planned work and implementation limits
Environment maps, textures and .fmat shader materials are planned.
No animation, physics or build-time asset import.
Checked in a browser; Linux, Android, iOS, macOS and Windows are not yet checked on a device.
A window can be a volume or an immersive space, with comfort settings, on a headset or glasses.
Passthrough asks for the camera first, and a world anchor is kept only with consent.
Partial
Spec section: XR: Spatial Presentation
Planned work and implementation limits
No native XR binding on any target yet, so spatial windows are not available on a device.
No dartvel build target for Android XR. Meta Horizon and visionOS build as 2D panels with a Dartvel Cloud plan.
FSL-1.1-MIT licensed. Built with Dartvel.
Dartvel is made by
To the bottom