How to show a banner over a movie ?
#1
with XBMC when i open a movie i want an adverting banner appear over current movie. can i do that ? ( use python, javascript, html ...)

thank you !
Reply
#2
please help !
Reply
#3
You need to create auto-start service addon with the following Python code:

PHP Code:
import xbmcgui

container 
xbmcgui.Window(12005)
banner xbmcgui.ControlImage(101020050"<full_path_to_banner_image_file>")
container.addControl(banner
Changing four digital parameters you can adjust your banner position and size.

How to create proper service addon please see XBMC WiKi.
Reply
#4
Thanks Roman_V_M.

I also found the wiki but did not see.

it works but when I change another banner but xbmc has not changed, it remember the old one. What should I do ?

Thanks !
Reply
#5
(2014-04-23, 12:15)ctcd Wrote: Thanks Roman_V_M.

I also found the wiki but did not see.

it works but when I change another banner but xbmc has not changed, it remember the old one. What should I do ?

Thanks !

First, how do you change the banner image? The proper way is setImage() method applied to a ControlImage class instance (banner).
Reply
#6
thank you very much Roman_V_M

what i must to do if i have 3 banners and want to show per banner in 5 seconds.
I used multi threading but failed.

Please help me Roman_V_M
Reply
#7
(2014-04-24, 11:26)ctcd Wrote: thank you very much Roman_V_M

what i must to do if i have 3 banners and want to show per banner in 5 seconds.
I used multi threading but failed.

Please help me Roman_V_M

"There are no psychics" © "Mentalist". I won't help you unless you describe what exactly you do with as much as possible details.
Reply
#8
Hi, Thank you Roman_V_M.

My problems are:

- when i play a movie using direct link ( example: http://mydomain.com/moviea.mp4 ), I can't to put 3 banners into " for loop " and use time.sleep () to show them. so i used multi threading but it is complex.

- if I use the function xbmc.player.play to play a moive, it works very good but when i click on a movie it always play from the beginning without the 2 options : play from time and start from beginning as i used direct link.

I think i will use the option 2. how to use the resume time with xbmc.player.play function ?

Please give me some advices.

Thank you so much Roman_V_M
Reply
#9
I still don't quite understand what you are doing and how you are doing it, and what it has to do with displaying banners.
Anyway, I think I've given you an answer to your specific question, and the whole implementation is completely up to you. Especially, if you don't share much details. Again: "There are no psychics" © "Mentalist".
Reply
#10
Thanks Roman_V_M

i succeed.

This is my code:

PHP Code:
while True:
     
#get banner from url
     #display
     
time.sleep(5

client -> request
server -> response back to client a banner

Last question Roman_V_M

I really don't underestand how xbmc can run on multi-flatform ?, such as: windows, android, ios ..... Beacause , python itself can't cross-platform

Thanks Thanks Thanks Roman_V_M
Reply
#11
(2014-04-28, 09:11)ctcd Wrote: I really don't underestand how xbmc can run on multi-flatform ?, such as: windows, android, ios ..... Beacause , python itself can't cross-platform

This is a very strange statement, because Python is essentially a cross-platform language, and well-written Python program can work on different platforms without any changes.
Reply
#12
thanks Roman_V_M

(2014-04-29, 10:57)Roman_V_M Wrote: This is a very strange statement, because Python is essentially a cross-platform language, and well-written Python program can work on different platforms without any changes.

I don't know how to compile a python program become a file with many extensions such as: exe,apk ( I am using pycharm IDE )
Reply
#13
I think you'd need a wrapping framework that embeds the python lib for every platform and then runs your code. Android will be a bitch though (if I remember our devs correctly). I'd just google for something like that.
Reply
#14
(2014-05-03, 07:04)ctcd Wrote: thanks Roman_V_M

(2014-04-29, 10:57)Roman_V_M Wrote: This is a very strange statement, because Python is essentially a cross-platform language, and well-written Python program can work on different platforms without any changes.

I don't know how to compile a python program become a file with many extensions such as: exe,apk ( I am using pycharm IDE )

XBMC compiles python on the fly.
No need to compile anything unless you want to hide your code. If so you need to do this for every platform and maybe for every specific python code release
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#15
(2014-05-03, 07:04)ctcd Wrote: thanks Roman_V_M

(2014-04-29, 10:57)Roman_V_M Wrote: This is a very strange statement, because Python is essentially a cross-platform language, and well-written Python program can work on different platforms without any changes.

I don't know how to compile a python program become a file with many extensions such as: exe,apk ( I am using pycharm IDE )

Python is not a compiled language (technically, it IS, but not from user's perspective). It belongs to a category that I would call "managed runtime language", like Java or .NET. Of course, there are some major differences between the latter and Pyhon, but the basic principle is the same: to launch a program written in a "managed runtime language" on a specific platform you need to install the necessary runtime environment for that platform. There are Python runtimes for most of the major OSs, except for Android, as it was said above.

BTW, XBMC has its own Python runtime environment, independent of the base OS Python (if any), modified for interaction with XBMC.
Reply

Logout Mark Read Team Forum Stats Members Help
How to show a banner over a movie ?0