v20 Is it possible to manually add chapters to a video?
#1
I have a video plugin that's working fine playing the videos.
Now I want to add chapters to single videos/entries, that can be extracted from some json files, but I can't find any way to do it.

At first I tried looking into the kodi docs if there's any method for that, but I couldn't find any. Searching the kodi forums for "chapters" didn't result in anything useful either. A dead thread from years ago kind of asked the same thing but never got an answer.

Today I got the idea to kind of circumvent that by adding context menu items for chapters, but I can't seem to be able to play anything I input there.
Errors I got look like these:

Code:
Trying to add a context menu item with f'PlayMedia(playeroffset={offset})'
2023-07-14 17:39:47.411 T:21228   error <general>: CFileCache::XFILE::CFileCache::Open - <playeroffset=4352> failed to open
2023-07-14 17:39:47.411 T:21228   error <general>: CVideoPlayer::OpenInputStream - error opening [playeroffset=4352]

Code:
Trying to add a context menu item with f'PlayMedia(media={url}, playeroffset={offset})'
2023-07-14 17:59:33.860 T:11108    info <general>: VideoPlayer::OpenFile: media=https://01.cdn.vod.farm/playlist/b1cd376c582d6b95f21c3f910ada8cd0.m3u8
2023-07-14 17:59:33.866 T:18596    info <general>: Deleting settings information for files plugin://plugin.video.gronkhtv/?action=play&video=738
2023-07-14 17:59:33.892 T:12836    info <general>: Creating InputStream
2023-07-14 17:59:33.892 T:12836 warning <general>: XFILE::CDirectoryFactory::Create - unsupported protocol(media=https) in media=https://01.cdn.vod.farm/playlist/
2023-07-14 17:59:34.147 T:12836 warning <general>: XFILE::CFileFactory::CreateLoader - unsupported protocol(media=https) in media=https://01.cdn.vod.farm/playlist/b1cd376c582d6b95f21c3f910ada8cd0.m3u8
2023-07-14 17:59:34.147 T:12836   error <general>: CVideoPlayer::OpenInputStream - error opening [media=https://01.cdn.vod.farm/playlist/b1cd376c582d6b95f21c3f910ada8cd0.m3u8]

Here's a link to the plugin source code for references: https://github.com/Yavos/plugin.video.gronkhtv/tree/dev

Can anybody help me achieving my goal to add chapters (in some way)?
Reply
#2
I don't think "playeroffset" is a valid parameter.  Should be playoffset, but that is only applicable to video/music playlists.  It doesn't cause play at some arbitrary point.  I don't know a way to seek to a specific time.

python:
        for c in chapters:
            title = str(c.get("title"))
            offset = int(c.get("offset"))
            cm.append((f'jump to [{seconds_to_time(offset)}]: {title}', f'PlayMedia(media={url}, playeroffset={offset})'))
        list_item.addContextMenuItems(cm)

scott s.
.
Reply

Logout Mark Read Team Forum Stats Members Help
Is it possible to manually add chapters to a video?0