Kodi Community Forum
code to play a video file - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+---- Forum: VideoPlayer Development (https://forum.kodi.tv/forumdisplay.php?fid=240)
+---- Thread: code to play a video file (/showthread.php?tid=339502)

Pages: 1 2


code to play a video file - R.O.H.3000 - 2019-01-18

hi, can someone tell me where I can find the code which starts a video/.strm when I press play in Kodi? In what file is it stored?

Specifically: What does the syntax look like?



Thank you a lot!
3000


RE: code to play a video file - R.O.H.3000 - 2019-01-18

this should not be so hard to answer.

Please help guys


RE: code to play a video file - Klojum - 2019-01-18

Is there a fire somewhere, bumping your own thread after 7.5 hours?


RE: code to play a video file - R.O.H.3000 - 2019-01-18

So, you like to see your posting number go up, I get. DON'T USE ME.


RE: code to play a video file - R.O.H.3000 - 2019-01-18

so back to topic:

hi, can someone tell me where I can find the code which starts a video/.strm when I press play in Kodi? In what file is it stored?

Specifically: What does the syntax look like?


Thank you a lot!
3000


RE: code to play a video file - MrTarantula - 2019-01-18

Short answer: I believe it's somewhere around here.

Long answer: I know enough C++ to know I don't know enough C++ to be able to begin to describe how complex the actions Kodi takes when you "press play".


RE: code to play a video file - R.O.H.3000 - 2019-01-18

thank you @MrTarantula 

if that's too complex, maybe there is an easier way for my problem.

I want to execute a little script when I press the play button. It should still start the video, but should also execute my script with it. 

Any idea how I can achieve that? 

My workaround now looks like this:

I use "Play using ..." to execute my script. 

Then I press play and the video starts.

So it's two steps which I'd like to combine into one.

Possible?


RE: code to play a video file - MrTarantula - 2019-01-18

See my answer in your other thread.


RE: code to play a video file - R.O.H.3000 - 2019-01-18

thank you, will do!


RE: code to play a video file - da-anda - 2019-01-19

you could write a python service that monitors f.e. the "onplaybackstarted" signal and then call your script in the background


RE: code to play a video file - R.O.H.3000 - 2019-01-19

thank you @da-anda 

would I be able to run different scripts as well?

And where do I begin??

Trying to learn how to create an add-on for my purpose, but maybe this will be easier to start with.


RE: code to play a video file - da-anda - 2019-01-20

you should be able to do whatever you want in your add-on. But since I'm no python dev, it's better to ask for help in the python add-on development section. Also having a look at our wiki should help to get you going with creating your own add-on


RE: code to play a video file - Karla2019 - 2019-07-28

I found one video about code which starts a video
*REMOVED BY MODERATOR*
I hope can help you


RE: code to play a video file - Klojum - 2019-07-28

(2019-07-28, 18:42)Karla2019 Wrote: I hope can help you

It's okay to help, but NOT by providing videos displaying Kodi setups that are using banned add-ons.
We have a 0-tolerance for video piracy on this forum. So... Don't do that again.


RE: code to play a video file - fandangos - 2019-07-29

xbmc/cores/videoplayer/videoplayer.cpp

Find: void CVideoPlayer::OnStartup()
{
Add your script here. 
}