Clapper.MediaItem¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
w/co/en |
|||
r/en |
|||
r/en |
|||
r/en |
|||
r/w/en |
|||
r/en |
|||
r/en |
|||
r/w/co/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Clapper.MediaItem(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Represents a media item.
A newly created media item must be added to player [class`Clapper`.Queue] first in order to be played.
- classmethod new(uri)¶
- Parameters:
uri (
str
) – a media URI- Returns:
a new
Clapper.MediaItem
.- Return type:
Creates new
Clapper.MediaItem
from URI.Use one of the URI protocols supported by plugins in #GStreamer installation. For local files you can use either “file” protocol or [ctor`Clapper`.MediaItem.new_from_file] method.
It is considered a programmer error trying to create new media item from invalid URI. If URI is valid, but unsupported by installed plugins on user system, [class`Clapper`.Player] will emit a [signal`Clapper`.Player::missing-plugin] signal upon playback.
- classmethod new_cached(uri, location)¶
- Parameters:
- Returns:
a new
Clapper.MediaItem
.- Return type:
Same as [ctor`Clapper`.MediaItem.new], but allows to provide a location of a cache file where particular media at uri is supposed to be found.
File at location existence will be checked upon starting playback of created item. If cache file is not found, media item uri will be used as fallback. In this case when [property`Clapper`.Player:download-enabled] is set to
True
, item will be downloaded and cached again if possible.New in version 0.8.
- classmethod new_from_file(file)¶
- Parameters:
- Returns:
a new
Clapper.MediaItem
.- Return type:
Creates new
Clapper.MediaItem
fromGio.File
.Same as [ctor`Clapper`.MediaItem.new], but uses a [iface`Gio`.File] for convenience in some situations instead of an URI.
- get_container_format()¶
-
Get media item container format.
- get_duration()¶
- Returns:
media duration.
- Return type:
Get media item duration as decimal number in seconds.
- get_id()¶
- Returns:
an ID of
Clapper.MediaItem
.- Return type:
Get the unique ID of
Clapper.MediaItem
.
- get_suburi()¶
- Returns:
an additional URI of
Clapper.MediaItem
.- Return type:
Get the additional URI of
Clapper.MediaItem
.
- get_timeline()¶
- Returns:
a
Clapper.Timeline
of item.- Return type:
Get the [class`Clapper`.Timeline] assosiated with self.
- get_title()¶
-
Get media item title.
The title can be either text detected by media discovery once it completes. Otherwise whenever possible this will try to return a title extracted from media URI e.g. basename without extension for local files.
- get_uri()¶
- Returns:
an URI of
Clapper.MediaItem
.- Return type:
Get the URI of
Clapper.MediaItem
.
- set_suburi(suburi)¶
- Parameters:
suburi (
str
) – an additional URI
Set the additional URI of
Clapper.MediaItem
.This is typically used to add an external subtitles URI to the self.
Property Details¶
- Clapper.MediaItem.props.cache_location¶
- Name:
cache-location
- Type:
- Default Value:
- Flags:
Media downloaded cache file location.
New in version 0.8.
- Clapper.MediaItem.props.container_format¶
- Name:
container-format
- Type:
- Default Value:
- Flags:
Media container format.
- Clapper.MediaItem.props.duration¶
- Name:
duration
- Type:
- Default Value:
0.0
- Flags:
Media duration as a decimal number in seconds.
- Clapper.MediaItem.props.id¶
- Name:
id
- Type:
- Default Value:
4294967295
- Flags:
Media Item ID.
- Clapper.MediaItem.props.suburi¶
- Name:
suburi
- Type:
- Default Value:
- Flags:
Media additional URI.
- Clapper.MediaItem.props.timeline¶
- Name:
timeline
- Type:
- Default Value:
- Flags:
Media timeline.
- Clapper.MediaItem.props.title¶
- Name:
title
- Type:
- Default Value:
- Flags:
Media title.
- Clapper.MediaItem.props.uri¶
- Name:
uri
- Type:
- Default Value:
- Flags:
Media URI.