MediaItem.cached


Description:

[ CCode ( has_construct_function = false ) ]
[ Version ( since = "0.8" ) ]
public MediaItem.cached (string uri, string? location)

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.

Parameters:

uri

a media URI

location

a path to downloaded file

Returns:

a new MediaItem.