Project idea: integrate a HTML5 compliant web browser engine into Kodi

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Hedda Offline
Fan
Posts: 676
Joined: Feb 2013
Reputation: 12
Post: #1
I'm not a student so this is not an application but this is a project idea for other student to implement a framework that I believe many users would love to see in Kodi.


Project idea: Firstly integrate an embedded HTML5-compliant web browser engine into Kodi and secondly add support for HTML5 apps as addons (including input support).

I think this may directly or indirectly be one of the most requested addition for Kodi/XBMC, as per the very long discussions over the years in these three discussion threads;
http://forum.kodi.tv/showthread.php?tid=25
http://forum.kodi.tv/showthread.php?tid=55093
http://forum.kodi.tv/showthread.php?tid=127847


Summary on these requests from what is generally wanted to be achieved with this is to be able use HTML5 apps inside the Kodi GUI with a simple remote control.

With content providers getting more content online quicker to streaming services and even traditional broadcast television companies embracing HTML5 as an industry standard in the form of HbbTV (Hybrid Broadcast Broadband TV), I now think that it's inevitable that an an embedded HTML5 engine must be integrated into natively Kodi sooner rater than later. For me the main reason for this is that HTML5 as an accepted industry standard really looks like the only way forward to allow "official" commercial apps to be added to Kodi as addons in a standard way. Providing an integrated HTML5 engine is an acceptable technology for larger content providers to add native support for the existing HTML5 application frameworks that many already now use for their existing apps.

My belief is that if and when Kodi could support standard HTML5 apps (maybe with or without future support for W3C EME extensions) then any content provider that already have HTML5 apps today would in theory at least have the option to port their apps into an"official" HTML5 addon for Kodi. Sure in reality any existing HTML5 apps would probably not "just work" in Kodi, at least not without adding support for input and after a lot of debugging, but in theory HTML5 is also simply HTML5 and it have standard methods for input and video. So as long as apps have none or only a simple DRM implementation based on open source code then many existing HTML5 apps should be relatively quick to port for companies if they are really interesting in providing their content to Kodi/XBMC users.

Hopefully having a HTML5 engine would also not have to be implemented a full web browser interface in Kodi, at least not in the GUI experience sense because only simple remote control style navigation should be needed for HTML5 apps as addons in Kodi, (as this is not so that you can browse websites or read webmail like in a desktop web browser, no this concept will mainly be used as a HTML5 framework for video apps/addons).


The suggestion I have as a implementation project for Google Summer of Code is to try to integrate CEF (Chromium Embedded Framework) into Kodi:

http://en.wikipedia.org/wiki/Chromium_Em..._Framework

Chromium Embedded Framework (CEF) is an open source framework for embedding a web browser control based on Google Chrome. It is a convenient way to implement an HTML5 based GUI in a desktop application or to provide browser capabilities to an application, and provides the infrastructure developers need to quickly add HTML renderer and JavaScript to a C++ project It also comes with bindings for C, C++, Delphi, Java, .NET, and Python and runs on Linux, Mac OS X, and Windows.

CEF insulates the user from the underlying Chromium and Blink code complexity by offering production-quality stable APIs, release branches tracking specific Chromium releases, and binary distributions.


I believe that CEF is probably the most well maintained and best documented HTML engine for embedding right now. Interestingly enough, CEF is written in C++ and is specifically designed for embedding it into an existing native application to add HTML5-compliant web browser control, so it should be perfect for Kodi integration. And maybe most importantly for Kodi integration, CEF supports: "Rendering Web content “off-screen” in applications that have their own custom drawing frameworks". As mentioned, hopefully it would not even have to be a full web browser if embedded into Kodi, at least not in the GUI experience sense as only simple remote control style navigation is needed, because is would primarily be used a framework for HTML5 addons and other HTML based addons inside Kodi.

Another approach could be making a HTML layout engine like CEF (or Chromium/WebKit/Blink/Gecko) into a new video player for Kodi, similar to the DVDPlayer, and have that player be cross-platform. I mean DVDPlayer code in Kodi is already very modular and can today use libdvdnav/libdvdread/libdvdcss to playback DVD-Video movies with menus, and it can use libbluray/libaacs to playback Blu-ray Disc movies with menus. So maybe an HTML layout engine like Chromium/WebKit/Blink/Gecko could be made into its own player for XBMC, and that way "playback" HTML5 apps with menus. At least then all the code would be contain within that one "Chromium/WebKit/Blink/Gecko" (HTML5) player. If that would be possible then it would also be simpler to one day replace that first HTML5 player with one made from a other HTML5 layout engine in the future.


Anyway, here is a good article about some benefits and what to consider when integrating Chromium Embedded Framework (CEF) as HTML5 rendering engine into applications like Kodi

http://coherent-labs.com/what-developers...eir-games/

Chromium Embedded Framework (CEF) is a free, open-source framework that is based on Chromium web browser and provides the infrastructure developers need to quickly add HTML renderer and JavaScript to a C++ project


https://code.google.com/p/chromiumembedded/

Chromium Embedded Framework (CEF) - Simple framework for embedding Chromium-based browsers in other applications


Introduction


The Chromium Embedded Framework (CEF) is a simple framework for embedding Chromium-based browsers in other applications. It is a BSD-licensed open source project founded by Marshall Greenblatt in 2008 and based on the Google Chromium project. Unlike the Chromium project itself, which focuses mainly on Google Chrome application development, CEF focuses on facilitating embedded browser use cases in third-party applications. CEF insulates the user from the underlying Chromium and Blink code complexity by offering production-quality stable APIs, release branches tracking specific Chromium releases, and binary distributions. Most features in CEF have default implementations that provide rich functionality while requiring little or no integration work from the user. There are currently over 100 million installed instances of CEF around the world embedded in products from a wide range of companies and industries. A partial list of companies and products using CEF is available on the CEF Wikipedia page. Some use cases for CEF include:
  • Embedding an HTML5-compliant Web browser control in an existing native application.
  • Creating a light-weight native “shell” application that hosts a user interface developed primarily using Web technologies.
  • Rendering Web content “off-screen” in applications that have their own custom drawing frameworks.
  • Acting as a host for automated testing of existing Web properties and applications.
    • CEF supports a wide range of programming languages and operating systems and can be easily integrated into both new and existing applications. It was designed from the ground up with both performance and ease of use in mind. The base framework includes C and C++ programming interfaces exposed via native libraries that insulate the host application from Chromium and Blink implementation details. It provides close integration between the browser and the host application including support for custom plugins, protocols, JavaScript objects and JavaScript extensions. The host application can optionally control resource loading, navigation, context menus, printing and more, while taking advantage of the same performance and HTML5 technologies available in the Google Chrome Web browser.

      Users new to CEF development should start by reading the Tutorial Wiki page for an overview of CEF usage and then proceed to the GeneralUsage Wiki page for a more in-depth discussion or architectural and usage issues. Complete API documentation is available here. CEF support and related discussion is available on the CEF Forum.

      Numerous individuals and organizations contribute time and resources to support CEF development, but more involvement from the community is always welcome. This includes support for both the core CEF project and external projects that integrate CEF with additional programming languages and frameworks (see the "External Projects" section below). If you are interested in donating time to help with CEF development please see the "Helping Out" section below. If you are interested in donating money to support general CEF development and infrastructure efforts please visit the CEF Donations page.

      Binary Distributions

      Binary distributions, which include all files necessary to build a CEF-based application, are available on the Downloads page. Automated nightly builds, available from http://cefbuilds.com, include the newest changes but may not be fully tested. Binary distributions are stand-alone and do not require the download of CEF or Chromium source code. Symbol files for debugging binary distributions of libcef can also be downloaded from the above links.

      Release notes for past and current CEF binary distributions are available here.

      Source Distributions

      The CEF project is an extension of the Chromium project. CEF maintains development and release branches that track Chromium branches. CEF source code can be downloaded, built and packaged manually or with automated tools. Visit the BranchesAndBuilding Wiki page for more information.
      External Projects

      The base CEF framework includes support for the C and C++ programming languages. Thanks to the hard work of external maintainers CEF can integrate with a number of other programming languages and frameworks. These external projects are not maintained by CEF so please contact the respective project maintainer if you have any questions or issues.


      Regarding alternative methods of rendering CEF onto a frame buffer under Linux checkout these tips:
      http://stackoverflow.com/questions/30326...eb-browser
      http://stackoverflow.com/questions/64509...ramebuffer
      https://groups.google.com/a/chromium.org...AEfjQEsemQ
      http://comments.gmane.org/gmane.linux.em...scale/7691
(This post was last modified: 2015-03-11 18:09 by Hedda.)
find quote
Hedda Offline
Fan
Posts: 676
Joined: Feb 2013
Reputation: 12
Post: #2
(2015-03-09 20:32)Hedda Wrote:  Another approach could be making a HTML layout engine like CEF (or Chromium/WebKit/Blink/Gecko) into a new video player for Kodi, similar to the DVDPlayer, and have that player be cross-platform. I mean DVDPlayer code in Kodi is already very modular and can today use libdvdnav/libdvdread/libdvdcss to playback DVD-Video movies with menus, and it can use libbluray/libaacs to playback Blu-ray Disc movies with menus. So maybe an HTML layout engine like Chromium/WebKit/Blink/Gecko could be made into its own player for XBMC, and that way "playback" Netflix HTML5 apps with menus. At least then all the code would be contain within that one "Chromium/WebKit/Blink/Gecko" (HTML5) player. If that would be possible then it would also be simpler to one day replace that first HTML5 player with one made from a other HTML5 layout engine in the future.
More thinking outside the box; Could a HTML5 engine like this be made into a Game Client Addon as a binary addon for RetroPlayer using garbear's Game API similar to the libretro wrapper?

http://forum.kodi.tv/showthread.php?tid=164725

RetroPlayer already works as a such player renderer and garbear's Game API already have a Hardware API for input too which will also be necessary, so wondering if a web browser engine could act as a Game Client Addon? Or perhaps an alternately would be to copy/replicate garbear's Game API and create a new Web Browser API parallel to the Game API, but using the same Hardware API for input as they will doing similar functions. This concept would abstract the HTML5 engine as a binary addon hrough an API like this would make it modular and even male HTML5 engines replaceable as binary addons, just as with Game Client Addons.

What do you guys think about this idea?

By the way, here below is garbear's layout design for how RetroPlayer and the Game API fits into Kodi today:

[Image: RetroPlayerTransparent_zps0b966969.png]

This is the current layout of the RetroOlayer project. It is centered around two APIs, the Game API (connects RetroPlayer to Game Clients) and the Hardware API (connects Game Clients to input). The Hardware API moves all of the joystick code out of XBMC and into binary addons. I have also started working on support for the Retrode and Retrode-like devices through the media reader sub-API.

You'll notice the only functional difference is that RetroPlayer is no longer connected to any input. I've re-written the joystick API two or three times, and the end result was never satisfactory because I couldn't separate the input from RetroPlayer. Now, with input gone, the complexity of RetroPlayer is greatly reduced, leading to more maintainable code.

Putting as much code as possible behind APIs is generally a good strategy. I learned this rather late in the development of RetroPlayer, so there are still quite a few parts that are entangled. however, looking at this diagram, I think I'm on the right track - components are finally only communicating with their API, and not with other components.
(This post was last modified: 2015-03-11 13:26 by Hedda.)
find quote
alwinus Offline
Team-XBMC Developer
Posts: 158
Joined: Aug 2008
Reputation: 4
Location: Mönchengladbach
Post: #3
I'm currently working since few weeks on a web browser for KODI, has not done this public until now. My way was to find a way to bring one webside on the GUI to see that it is possible and then to make public and with others to build up a complete browser based on KODI's GUI and Skin system

To integrate this is a really hard way and not want to not come on end with the words "Sorry is too much for me Rolleyes".
My way is based upon firefox and a bit in a complicated system.

For me is the only way to use a separate GUI Control. There are several TV channels as example which need web access during playback and make then no sense to use DVDPlayer for stream the Webside window.

I can not say in the moment that I find a way and need a bit time.
(This post was last modified: 2015-03-11 13:44 by alwinus.)
find quote
da-anda Offline
Team-Kodi Member
Posts: 5,777
Joined: Jun 2009
Reputation: 77
Location: germany
Post: #4
Please keep in mind that what alwinus is working on does in NO WAY incorporate a HTML5 video player - so keep any discussion about Netflix and DRM out of this topic - it's not part of his project goal. The goal is to get a browser to view websites into Kodi, no HTML5 addons and no dedicated HTML5 media players in this step.
(This post was last modified: 2015-03-11 14:14 by da-anda.)
find quote
Hedda Offline
Fan
Posts: 676
Joined: Feb 2013
Reputation: 12
Post: #5
(2015-03-11 14:14)da-anda Wrote:  Please keep in mind that what alwinus is working on does in NO WAY incorporate a HTML5 video player - so keep any discussion about Netflix and DRM out of this topic - it's not part of his project goal. The goal is to get a browser to view websites into Kodi, no HTML5 addons and no dedicated HTML5 media players in this step.
Yeah as you said, that doesn't sound as a similar concept to my suggested ideas above. And while I agree that this shouldn't become a thread about DRM, I don't think it's wrong just to mention W3C EME which is only an open specification of an API for supporting DRM clients, not a DRM implementation itself. I have however removed the mentioning of Netflix regardless.

Having a full web browser inside Kodi for desktop website browsing and viewing might be the goal for alwinus project, but that is however not the end goal of my idea suggestions above.
(This post was last modified: 2015-03-11 18:08 by Hedda.)
find quote
da-anda Offline
Team-Kodi Member
Posts: 5,777
Joined: Jun 2009
Reputation: 77
Location: germany
Post: #6
@Hedda, sure, but It's the first step. You first need the possibility to execute and render a HTML engine inside Kodi. Once this is done we could try getting HTML5 apps in shape, and after that is working stuff like EME could be given a try.
find quote
Hedda Offline
Fan
Posts: 676
Joined: Feb 2013
Reputation: 12
Post: #7
(2015-03-11 13:40)alwinus Wrote:  I'm currently working since few weeks on a web browser for KODI, has not done this public until now. My way was to find a way to bring one webside on the GUI to see that it is possible and then to make public and with others to build up a complete browser based on KODI's GUI and Skin system

To integrate this is a really hard way and not want to not come on end with the words "Sorry is too much for me Rolleyes".
My way is based upon firefox and a bit in a complicated system.

For me is the only way to use a separate GUI Control. There are several TV channels as example which need web access during playback and make then no sense to use DVDPlayer for stream the Webside window.

I can not say in the moment that I find a way and need a bit time.
@alwinus, do you have any updates on this Kodi-Web / CEF for Kodi project?

http://esmasol.de/open-source/kodi-add-o...b-browser/

https://github.com/AlwinEsch/web.browser.chromium

https://bitbucket.org/kodi-web/cef/src
find quote
Gregoire Offline
Senior Member
Posts: 140
Joined: Jan 2011
Reputation: 1
Post: #8
Any news on this project going forward?
find quote