Posts: 15
Joined: May 2010
Reputation:
0
itaibh
Junior Member
Posts: 15
I think it would be very helpful adding an HTML rendering engine like WebKit inside XBMC, so it would be possible to write HTML5 add-ons.
It can also provide special JavaScript based features for remote control, media playback, etc.
Posts: 1,265
Joined: Oct 2009
Reputation:
29
takoi
Team-Kodi Member
Posts: 1,265
So we can have less integration and less uniform look and feel? And for what purpose?
Posts: 15
Joined: May 2010
Reputation:
0
itaibh
Junior Member
Posts: 15
I wasn't talking about HTML5 videos. I meant to have the ability to play XBMC videos using JavaScript.
Regarding the look and feel - with some caution it is possible to create a CSS file (one per skin) that resembles the look and feel of that skin, given some common styling semantics (like marking a button div in class "XBMC_BUTTON").
Besides the point it would be helpful to create a web-browser for browsing the internet using the TV (Yes, I know, not the purpose of XBMC, and other yada yada, but many people still want it) it will help making all kinds of applications that will take much more time to write without HTML5 support (I thought it would be nice to have a maps application that allows you to look for places, get directions, etc; For people who invest their money one can provide stocks quotes, and graphs; A simple integrated web-browser can be used to show the content of each item in the RSS ticker, and much more).
HTML5 gets it much closer to "write once - deploy everywhere" methodology, so I think it is some worth investing time in.
Posts: 17,859
Joined: Jul 2011
Reputation:
371
Like we always say: "code welcome"
Posts: 1,265
Joined: Oct 2009
Reputation:
29
takoi
Team-Kodi Member
Posts: 1,265
2012-09-11, 18:19
(This post was last modified: 2012-09-11, 18:20 by takoi.)
The way I understood him, he wants a web view a la android so he don't have to make a plugin, but deploy a bookmark as an addon with a nice picture
Posts: 15
Joined: May 2010
Reputation:
0
itaibh
Junior Member
Posts: 15
Actually I meant to something more like Google Chrome Extensions (or to any HTML5 app that uses PhoneGap), where all the resources are packed in one folder, and there are some external resources implanted by the framework (such as the extra CSS resources I suggested for common appearance).
Let me give you an example:
XBMC will open a web browser window (no address bar or navigation buttons) and will load an HTML5 addon into it.
The addon itself is placed in a folder of its own like any other addon, except it consists of HTML file(s) and optional resource files.
XBMC will inject it's current theme CSS into the loaded document. The theme itself can be hand written by the theme developer, or it can be automatically generated by a set of rules (for example, a button nine-patch can become an image based border).
XBMC will inject some common control functions into the loaded document, such as remote-control callbacks, playback functions, settings functions, etc. The actual functions being injected can be decided by a manifest provided along with the addon.
Suppose the user wants to create a stock-market app - He designs the app in HTML, making sure to set element's classes according to a guideline.
He then registers to remote control callbacks for easy navigation (actually perhaps XBMC should translate remote control events to keyboard events, but it's something worth thinking about).
Next he uses HTML5 methodologies to get the stock data (XmlHttpRequest, perhaps) and for storage (LocalStorage, SessionStorage) and present it using divs, canvas, css, javascript, everything html supports.
XBMC should register the 'Back' button and 'Home' button of the remote control to override everything, so Home always exits to the home menu, and back, if wasn't handled by the user, exits and goes back the previous menu.
I hope this explanation answers some questions.
Posts: 4,549
Joined: Dec 2007
Reputation:
17
topfs2
Team-Kodi Developer
Posts: 4,549
Ah ok, yeah that does explain things quite a bit. So in essence you want to be able to create addons with html5 instead of python. This is not a bad idea and part of it will become possible with the new generation toolkit jimcarrol is working on. I.e. we are able to generate javascript bindings as we generate python bindings (they are handcrafted now).
Is there a framework or specification already written up which apps uses? So we could piggy back on already existing instead of creating it from scratch?
If you have problems please read
this before posting
Always read the
XBMC online-manual,
FAQ and
search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the
forum rules.
For troubleshooting and bug reporting please make sure you
read this first.
"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Posts: 1,265
Joined: Oct 2009
Reputation:
29
takoi
Team-Kodi Member
Posts: 1,265
2012-09-12, 11:08
(This post was last modified: 2012-09-12, 11:08 by takoi.)
Maybe this would be useful for addons that use xbmcgui to make custom controls, windows and such (because that thing is brutal), but I really hope it doesn't become a trend to replace xbmc's nice virtual filesystem that is the plugin, with html. (Yes I really hate web apps. Especially on devices like mobile and htpc which are all about usability)
Posts: 15
Joined: May 2010
Reputation:
0
itaibh
Junior Member
Posts: 15
There are plenty of javascript frameworks out there for all kinds of tasks, but as hosting framework I'm only somewhat familiar with PhoneGap, which is, unfortunately, not open source and does not do the things needed in XBMC.
I think that the best way to start is to learn how each html5 rendering engine of the open sourced ones behaves when it comes to injecting extra functions and styles from the outside thus integrating it with its hosting environment, then choose one and start moving on with it. As I said in the first post, I think WebKit is great choice, but there are other alternatives that should be considered such as Gecko (Mozilla) (Unfortunately I couldn't find any other open source HTML rendering engines, so unless anyone knows about some other, those two would have to do).
Posts: 4,549
Joined: Dec 2007
Reputation:
17
topfs2
Team-Kodi Developer
Posts: 4,549
So I looked at phoneGap a bit, the license is apache so might be slightly usable, however, I couldn't find a single document about how to use the darn API (terrible website IMO). I did not look that hard but all I found was guide on how to set it up on various phones, not how to actually write apps for it.
Looking at the apps created, they all look extremely touch oriented, which will never work with xbmc.
TBH, it feels like we would be much better off supporting other frameworks which aren't html5, like kivy or löve.
If you have problems please read
this before posting
Always read the
XBMC online-manual,
FAQ and
search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the
forum rules.
For troubleshooting and bug reporting please make sure you
read this first.
"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Posts: 4,549
Joined: Dec 2007
Reputation:
17
topfs2
Team-Kodi Developer
Posts: 4,549
Oh btw, regarding my last post. Obviously html5 and such could easily work along side kivy or löve, I didn't mean it as either choose a) or b) kindof scenario. Just that the API provided in PhoneGAP sadly doesn't seem to fit afaik?
If you have problems please read
this before posting
Always read the
XBMC online-manual,
FAQ and
search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the
forum rules.
For troubleshooting and bug reporting please make sure you
read this first.
"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."