Video Advertising Suite

Docs

> Documentation-Index > Implementation Guide

HbbTV Sample App

Implementation Guideline

3. Safeguarding the Video Player: The Player Facade

The Player Facade translates calls from the smartclientcore to methods of the Player API. The facade for the sample app can be found in js/ceHtmlFacade.js.

It must be included next to the player API source file.

--- index.html
+++ index.html

     <script type="text/javascript" crossorigin="anonymous" src="vendor_modules/smartclip/smartclientcore.min.js"></script>
+    <script type="text/javascript" crossorigin="anonymous" src="js/ceHtmlFacade.js"></script>
     <script type="text/javascript" crossorigin="anonymous" src="js/main.js"></script>

Extract from the index.html :: Adding the player facade

Background

In order to avoid unexpected calls to the player API, it is mandatory to safeguard the player API with a player-specific facade.

Using the facade has two main reasons:

  • Provide a generic player interface the smartclientcore can safely talk to
  • Capture and validate requests made by the smartclientcore towards the player API

To get you started, please have a look at the Facade and Video Player Interface specification and get familiar with the common facade class that can be found in vendor_modules/smartclip/FacadeBase.js.

Regardless of whether the facade could solve other tasks, like loading a new source requested by a playlist controller, the facade should be reserved to handle requests from the smartclientcore only. It makes debugging much easier, if the facade is used from only one direction.

Next: Creating an Ad Controller
Prev: Installing the smartclientcore
Top: Implementation Guide Overview