HTML 5 plugins
#1
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.
Reply
#2
(2012-09-09, 21:50)itaibh Wrote: 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.

That is a brilliant idea! This way the process of script developing would become a breeze and a wider range of developers get attracted to XBMC. Cool! Nod
Reply
#3
So we can have less integration and less uniform look and feel? And for what purpose?
Reply
#4
You don't need a webkit to render html5 videos....

Just use beautifulsoup to extract the video tag and feed the src to xbmc.

Example html 5 video http://www.netmagazine.com/files/tutoria...demo/0.htm
This would still work just fine if they have buttons on the website, as done in http://www.netmagazine.com/files/tutoria...demo/1.htm
Even fancy overlays work, since its just css http://www.netmagazine.com/files/tutoria...demo/2.htm
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.

Image

"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#."
Reply
#5
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.
Reply
#6
Like we always say: "code welcome"
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
#7
(2012-09-11, 15:14)itaibh Wrote: I wasn't talking about HTML5 videos. I meant to have the ability to play XBMC videos using JavaScript.

Uhm, you lost me? do you want to play videos you have within your xbmc library using javascript and html5? i.e make a web interface in html5? because thats doable already

If your talking about getting youtube videos and other sites into xbmc then
(2012-09-11, 15:14)itaibh Wrote: HTML5 gets it much closer to "write once - deploy everywhere" methodology, so I think it is some worth investing time in.
(2012-09-11, 15:14)itaibh Wrote: 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").

So your suggesting that you need to write once and deloy everywhere, yet to acquire uniform feel you need css on each site for each skin? This doesn't deploy everywhere then. And if you add a new skin you'd need to go back and alter ALL sites previously skinned.

The solution I suggested means you write a 5-10 line python script for each site (and if you bumped it up to say 50-100 lines probably hit 90% of all sites if the plugin just provided a url). This solution will scale to any skin, i.e. a skinner needs only try one site and the skin will work on all sites and a site only needs to try one skin and it scales to all skins.

The thing with HTML 5 and that it becomes de facto is great for xbmc, since it means that for the first time we don't _need_ a webbrowser to play the content, we can fetch it easily through the markup.

Please correct me if I have missunderstood.
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.

Image

"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#."
Reply
#8
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
Reply
#9
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.
Reply
#10
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.

Image

"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#."
Reply
#11
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)
Reply
#12
(2012-09-12, 11:08)takoi Wrote: 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)

+1

What it might be useful for could be games (which could just as easily be launched instead of living in app) and perhaps the odd program (which could also be launched). It has a rather small usability tbh.

Rest assured, we did discuss the API in xbmc quite a bit during devcon and we aim to alter the xbmcgui (and lots more) quite a bit. To create a more uniform feel of the API and make it possible to bind to any language (even javascript)
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.

Image

"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#."
Reply
#13
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).
Reply
#14
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.

Image

"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#."
Reply
#15
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.

Image

"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#."
Reply

Logout Mark Read Team Forum Stats Members Help
HTML 5 plugins2