Widgets

Video

Video

Video control. Build it with the video helper.

Example

video(
  title: text("Title"),
  width: 240,
  height: 120,
  on_completed: ->(event) {}
)

Properties

  • alignment — Alignment of the content within the control.
  • autoplay — Sets the autoplay property.
  • configuration — Sets the configuration property.
  • fill_color — Fill color.
  • filter_quality — Sets the filter quality property.
  • fit — Sets the fit property.
  • fullscreen — Sets the fullscreen property.
  • muted — Sets the muted property.
  • pause_upon_entering_background_mode — Sets the pause upon entering background mode property.
  • pitch — Sets the pitch property.
  • playlist — Sets the playlist property.
  • playlist_mode — Sets the playlist mode property.
  • playback_rate — Sets the playback rate property.
  • resume_upon_entering_foreground_mode — Sets the resume upon entering foreground mode property.
  • show_controls — Sets the show controls property.
  • shuffle_playlist — Sets the shuffle playlist property.
  • subtitle_configuration — Sets the subtitle configuration property.
  • title — The control shown as the title.
  • volume — Sets the volume property.
  • wakelock — Sets the wakelock property.

Common layout and animation properties

  • aspect_ratio — Width-to-height ratio to maintain.
  • data — Arbitrary value you can attach to the control and read back in handlers.
  • height — Fixed height in logical pixels.
  • key — Stable identity used to preserve state across rebuilds.
  • opacity — Opacity from 0.0 (transparent) to 1.0 (opaque).
  • rtl — Renders right-to-left when true.
  • tooltip — Text shown on hover/long-press.
  • visible — Hides the control when false.
  • width — Fixed width in logical pixels.

Events

  • on_completed — Fired on completed.
  • on_complete — Fired on complete.
  • on_enter_fullscreen — Fired on enter fullscreen.
  • on_error — Fired when an error occurs.
  • on_exit_fullscreen — Fired on exit fullscreen.
  • on_load — Fired on load.
  • on_loaded — Fired when the control has loaded.
  • on_state_change — Fired when the control's state changes.
  • on_track_change — Fired on track change.
  • on_track_changed — Fired on track changed.

Methods

  • get_current_position(timeout: ..., on_result: ...)
  • get_duration(timeout: ..., on_result: ...)
  • is_completed(timeout: ..., on_result: ...)
  • is_playing(timeout: ..., on_result: ...)
  • jump_to(media_index, timeout: ..., on_result: ...)
  • next(timeout: ..., on_result: ...)
  • pause(timeout: ..., on_result: ...)
  • play(timeout: ..., on_result: ...)
  • play_or_pause(timeout: ..., on_result: ...)
  • playlist_add(media = ..., timeout: ..., on_result: ..., **props)
  • playlist_remove(media_index, timeout: ..., on_result: ...)
  • previous(timeout: ..., on_result: ...)
  • seek(position_milliseconds, timeout: ..., on_result: ...)
  • stop(timeout: ..., on_result: ...)

Reference

  • Family: materials
  • Widget type: video
  • Helpers: video