Kodi Community Forum
Play video by passing it to another addon - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Play video by passing it to another addon (/showthread.php?tid=357129)



Play video by passing it to another addon - pa79 - 2020-09-16

I'm writing a video addon that offers free videos from other websites. Playing these video files directly through the xbmc.player poses no problems but I don't know what to do when these videos are hosted on sites like Vimeo or YouTube.

I have the player links or IDs of the videos but is there a way to launch an other addon (like the Vimeo or YouTube addons) as player? I'm using Kodi on LibreElec/RPi4.

I could only find out how to configure an external player through playercorefactory.xml but not how to pass an url or ID to another addon.


RE: Play video by passing it to another addon - Space2Walker - 2020-10-17

(2020-09-16, 14:19)pa79 Wrote: I'm writing a video addon that offers free videos from other websites. Playing these video files directly through the xbmc.player poses no problems but I don't know what to do when these videos are hosted on sites like Vimeo or YouTube.

I have the player links or IDs of the videos but is there a way to launch an other addon (like the Vimeo or YouTube addons) as player? I'm using Kodi on LibreElec/RPi4.

I could only find out how to configure an external player through playercorefactory.xml but not how to pass an url or ID to another addon.

For youtube you only need to call the addon with its url and replace the [ID]
Code:
xbmc.executebuiltin(RunPlugin("plugin://plugin.video.youtube/?action=play_video&videoid=[ID]")



RE: Play video by passing it to another addon - ltai0001 - 2022-05-12

@Space2Walker 
I used the command to play the video but Kodi crashes as soon as I call it.
Below is the log

utojoyofos (paste)


RE: Play video by passing it to another addon - Sidewinder_2011 - 2022-05-12

(2022-05-12, 04:20)ltai0001 Wrote: @Space2Walker 
I used the command to play the video but Kodi crashes as soon as I call it.
Below is the log

utojoyofos (paste)

In the log it's says " the api key is invalid for youtube "


RE: Play video by passing it to another addon - ltai0001 - 2022-05-13

That’s a weird one I am pretty sure it is valid because the YouTube addon works and I can see videos s without getting any warnings


RE: Play video by passing it to another addon - ltai0001 - 2022-05-13

I think it’s these lines that cause the crash but not sure how to interpret

Code:
2022-05-11 19:17:38.896 T:779 ERROR <general>: CCurlFile::FillBuffer - Failed: Failure when receiving data from the peer(56)
2022-05-11 19:17:38.896 T:779 WARNING <general>: CCurlFile::FillBuffer - Reconnect, (re)try 1
2022-05-11 19:17:39.164 T:779 ERROR <general>: CCurlFile::FillBuffer - Failed: Failure when receiving data from the peer(56)
2022-05-11 19:17:39.164 T:779 WARNING <general>: CCurlFile::FillBuffer - Reconnect, (re)try 2
2022-05-11 19:17:39.310 T:744 ERROR <general>: Could not find suitable input format: x-directory/normal
2022-05-11 19:17:39.470 T:779 ERROR <general>: CCurlFile::FillBuffer - Failed: Failure when receiving data from the peer(56)
2022-05-11 19:17:39.470 T:779 ERROR <general>: CFileCache:Tonguerocess - <https://rr1---sn-n4v7snl7.googlevideo.com/videoplayback?expire=1652343458&ei



RE: Play video by passing it to another addon - sarbes - 2022-05-13

Without seeing any code, we can only guess.

This being said, executing a plugin from a plugin like in the post above is not supported. Pass the plugin:// URI like a normal playable item.


RE: Play video by passing it to another addon - ltai0001 - 2022-05-14

Hi
Thank you for your feedback,
How do I do it this? These are YouTube videos with YouTube IDs that I am dealing with

Quote: Pass the plugin:// URI like a normal playable item.



RE: Play video by passing it to another addon - ltai0001 - 2022-05-14

ok I recreated the youtube API and keys and I dont get the invalid key error anymore but now I am into a new issue 
2022-05-14 11:31:40.356 T:139 ERROR <general>: Open - error probing input format, https://www.youtube.com/watch?v=DSqDfW203Rc
2022-05-14 11:31:40.356 T:139 ERROR <general>: OpenDemuxStream - Error creating demuxer
Full Log Here


RE: Play video by passing it to another addon - ltai0001 - 2022-05-16

I am good on this
I actually used the below command to pass the video URL for Kodi to play
Code:
xbmcplugin.setResolvedUrl(_HANDLE, True, listitem=play_item)
The URL for the youtube video should look like this (replace YoutubeID with the ID of the video from youtube)
Code:
plugin://plugin.video.youtube/play/?video_id='+YoutubeID
no crashes of Kodi anymore and it plays the video with no issue on my Pi 3 osmc


RE: Play video by passing it to another addon - sarbes - 2022-05-18

That's the way to do it.

Alternatively, you could pass the plugin URI directly via the listitem when setting up the directory, if you know the ID's at this time.