Skip to contents

Classes and constructors to wrap media into widgets

Usage

ImageWidget(...)

VideoWidget(...)

AudioWidget(...)

Arguments

...

Any arguments used to initialize the fields of the object

Functions

  • ImageWidget(): The ImageWidget constructor function

  • VideoWidget(): The VideoWidget constructor function

  • AudioWidget(): The AudioWidget constructor function

Super classes

HasTraits -> Widget -> DOMWidget -> DescriptionWidget -> ValueWidget -> MediaWidget

Public fields

format

A string, giving the graphics fromat.

value

A Bytes traitlet.

Methods

Inherited methods


MediaWidget$from_url()

Create media widget from url

Usage

MediaWidget$from_url(url, width = NULL, height = NULL)

Arguments

url

A character string

width

A character string with CSS width specification

height

A character string with CSS height specification


MediaWidget$from_file()

Create media widget from file

Usage

MediaWidget$from_file(filename)

Arguments

filename

A character string


MediaWidget$on_change()

Add or remove a handler to be called if value is changed.

Usage

MediaWidget$on_change(handler, remove = FALSE)

Arguments

handler

A function that is called when the button is clicked.

remove

Logical value, whether the handler is to be removed.


MediaWidget$new()

Initialize an object

Usage

MediaWidget$new(from_file = NULL, from_url = NULL, ...)

Arguments

from_file

An optional character string, name of the file from which to initialize the widget.

from_url

An optional character string, URL from which to initialize the widget.

...

Other arguments, passed to the superclass initializer.


MediaWidget$clone()

The objects of this class are cloneable with this method.

Usage

MediaWidget$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Super classes

HasTraits -> Widget -> DOMWidget -> DescriptionWidget -> ValueWidget -> MediaWidget -> ImageWidget

Public fields

_view_name

Name of the Javascript view in the frontend.

_model_name

Name of the Javascript model in the frontend.

format

A string, giving the graphics fromat.

width

A string, describing the width in CSS language, e.g. "480px".

height

A string, describing the height in CSS language, e.g. "480px".

Methods

Inherited methods


ImageWidget$from_file()

Create image widget from file

Usage

ImageWidget$from_file(filename, width = NULL, height = NULL)

Arguments

filename

A character string

width

A character string with CSS width specification

height

A character string with CSS height specification


ImageWidget$clone()

The objects of this class are cloneable with this method.

Usage

ImageWidget$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Super classes

HasTraits -> Widget -> DOMWidget -> DescriptionWidget -> ValueWidget -> MediaWidget -> VideoWidget

Public fields

_view_name

Name of the Javascript view in the frontend.

_model_name

Name of the Javascript model in the frontend.

format

A string, giving the video fromat.

width

A string, describing the width in CSS language, e.g. "480px".

height

A string, describing the height in CSS language, e.g. "480px".

autoplay

Boolean, when TRUE the video starts when it is displayed.

loop

Boolean, when TRUE the video restarts after finishing.

controls

Boolean, when TRUE then video controls are shown.

Methods

Inherited methods


VideoWidget$from_file()

Create image widget from file

Usage

VideoWidget$from_file(filename, width = NULL, height = NULL)

Arguments

filename

A character string

width

A character string with CSS width specification

height

A character string with CSS height specification


VideoWidget$clone()

The objects of this class are cloneable with this method.

Usage

VideoWidget$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Super classes

HasTraits -> Widget -> DOMWidget -> DescriptionWidget -> ValueWidget -> MediaWidget -> AudioWidget

Public fields

_view_name

Name of the Javascript view in the frontend.

_model_name

Name of the Javascript model in the frontend.

format

A string, giving the audio fromat.

autoplay

Boolean, when TRUE the video starts when it is displayed.

loop

Boolean, when TRUE the video restarts after finishing.

controls

Boolean, when TRUE then video controls are shown.