Kodi Community Forum

Full Version: code to play a video file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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
this should not be so hard to answer.

Please help guys
Is there a fire somewhere, bumping your own thread after 7.5 hours?
So, you like to see your posting number go up, I get. DON'T USE ME.
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
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".
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?
See my answer in your other thread.
thank you, will do!
you could write a python service that monitors f.e. the "onplaybackstarted" signal and then call your script in the background
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.
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
I found one video about code which starts a video
*REMOVED BY MODERATOR*
I hope can help you
(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.
xbmc/cores/videoplayer/videoplayer.cpp

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