Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
KODI::VIDEO::UTILS Namespace Reference

Classes

struct  ResumeInformation
 

Enumerations

enum class  QueuePosition { POSITION_BEGIN , POSITION_END }
 

Functions

void PlayItem (const std::shared_ptr< CFileItem > &item, const std::string &player, ContentUtils::PlayMode mode=ContentUtils::PlayMode::CHECK_AUTO_PLAY_NEXT_ITEM)
 Start playback of the given item. If the item is a folder, build a playlist with all items contained in the folder and start playback of the playlist. If item is a single video item, start playback directly, without adding it to the video playlist first.
 
void QueueItem (const std::shared_ptr< CFileItem > &item, QueuePosition pos)
 Queue the given item in the currently active playlist. If no playlist is active, put the item into the video playlist.
 
bool GetItemsForPlayList (const std::shared_ptr< CFileItem > &item, CFileItemList &queuedItems)
 For a given item, get the items to put in a playlist. If the item is a folder, all subitems will be added recursively to the returned item list. If the item is a playlist, the playlist will be loaded and contained items will be added to the returned item list. Shows a busy dialog if action takes certain amount of time to give the user visual feedback.
 
bool IsItemPlayable (const CFileItem &item)
 Check whether the given item can be played by the app playlist player as one or more videos.
 
std::string GetResumeString (const CFileItem &item)
 Get a localized resume string for the given item, if it is resumable.
 
std::string GetOpticalMediaPath (const CFileItem &item)
 Check whether an item is an optical media folder or its parent. This will return the non-empty path to the playable entry point of the media one or two levels down (VIDEO_TS.IFO for DVDs or index.bdmv for BDs). The returned path will be empty if folder does not meet this criterion.
 
bool IsAutoPlayNextItem (const CFileItem &item)
 Check whether auto play next item is set for the media type of the given item.
 
bool IsAutoPlayNextItem (const std::string &content)
 Check whether auto play next item is set for the given content type.
 
ResumeInformation GetItemResumeInformation (const CFileItem &item)
 Check whether playback of the given item can be resumed, get detailed information.
 
ResumeInformation GetStackPartResumeInformation (const CFileItem &item, unsigned int partNumber)
 Get resume information for a part of a stack item.
 

Enumeration Type Documentation

◆ QueuePosition

Enumerator
POSITION_BEGIN 
POSITION_END 

Function Documentation

◆ GetItemResumeInformation()

ResumeInformation KODI::VIDEO::UTILS::GetItemResumeInformation ( const CFileItem & item)

Check whether playback of the given item can be resumed, get detailed information.

Parameters
itemThe item to retrieve information for
Returns
The resume information.

◆ GetItemsForPlayList()

bool KODI::VIDEO::UTILS::GetItemsForPlayList ( const std::shared_ptr< CFileItem > & item,
CFileItemList & queuedItems )

For a given item, get the items to put in a playlist. If the item is a folder, all subitems will be added recursively to the returned item list. If the item is a playlist, the playlist will be loaded and contained items will be added to the returned item list. Shows a busy dialog if action takes certain amount of time to give the user visual feedback.

Parameters
item[in] the item to add to the playlist
queuedItems[out] the items that can be put in a play list
Returns
true on success, false otherwise

◆ GetOpticalMediaPath()

std::string KODI::VIDEO::UTILS::GetOpticalMediaPath ( const CFileItem & item)

Check whether an item is an optical media folder or its parent. This will return the non-empty path to the playable entry point of the media one or two levels down (VIDEO_TS.IFO for DVDs or index.bdmv for BDs). The returned path will be empty if folder does not meet this criterion.

Returns
non-empty string if item is optical media folder, empty otherwise.

◆ GetResumeString()

std::string KODI::VIDEO::UTILS::GetResumeString ( const CFileItem & item)

Get a localized resume string for the given item, if it is resumable.

Parameters
itemThe item to retrieve the resume string for
Returns
The resume string or empty string in case the item is not resumable.

◆ GetStackPartResumeInformation()

ResumeInformation KODI::VIDEO::UTILS::GetStackPartResumeInformation ( const CFileItem & item,
unsigned int partNumber )

Get resume information for a part of a stack item.

Parameters
itemThe stack item to retrieve information for
partNumberThe number of the part
Returns
The resume information.

◆ IsAutoPlayNextItem() [1/2]

bool KODI::VIDEO::UTILS::IsAutoPlayNextItem ( const CFileItem & item)

Check whether auto play next item is set for the media type of the given item.

Parameters
item[in] the item to check
Returns
True if auto play next item is active, false otherwise.

◆ IsAutoPlayNextItem() [2/2]

bool KODI::VIDEO::UTILS::IsAutoPlayNextItem ( const std::string & content)

Check whether auto play next item is set for the given content type.

Parameters
item[in] the content to check
Returns
True if auto play next item is active, false otherwise.

◆ IsItemPlayable()

bool KODI::VIDEO::UTILS::IsItemPlayable ( const CFileItem & item)

Check whether the given item can be played by the app playlist player as one or more videos.

Parameters
itemThe item to check
Returns
True if playable, false otherwise.

◆ PlayItem()

void KODI::VIDEO::UTILS::PlayItem ( const std::shared_ptr< CFileItem > & item,
const std::string & player,
ContentUtils::PlayMode mode = ContentUtils::PlayMode::CHECK_AUTO_PLAY_NEXT_ITEM )

Start playback of the given item. If the item is a folder, build a playlist with all items contained in the folder and start playback of the playlist. If item is a single video item, start playback directly, without adding it to the video playlist first.

Parameters
item[in] the item to play
player[in] the player to use, empty for default player
mode[in] queue all successors and play them after item

◆ QueueItem()

void KODI::VIDEO::UTILS::QueueItem ( const std::shared_ptr< CFileItem > & item,
QueuePosition pos )

Queue the given item in the currently active playlist. If no playlist is active, put the item into the video playlist.

Parameters
item[in] the item to queue
pos[in] whether to place the item and the begin or the end of the queue