Git Product home page Git Product logo

html5-skin's Introduction

html5-skin

An open-source HTML5 UI skin based on React.js that overlays Ooyala V4 core player. This README contains introduction, setup and customization sections.

High Level Overview

html5-skin is a JS file that is made available externally to Ooyala core V4 player. It accepts and triggers general Ooyala Message Bus events from and to core player to change the behavior of video playback. All static files necessary to create and run video playback are hosted and can be accessed publicly. This skin repo are available to be git cloned or forked and be modified by developers (terms and condition apply).

Plug and Play capability

core.js is a lightweight core player that enables basic video playback functionality and provides Message Bus environment. Most of additional capabilities such as ads, discovery and skin are separated from core player JS. You may want to load additional plugins.

Examples

We have a sample HTML page ready for you. Check out sample page

This simple test HTML page can also be hosted on your environment to showcase html5 skin.

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <!-- V4 JS core and at least one video plugin is required. Plugins such as skin, discovery and Advertising need to be loaded separately -->
  <script src="//player.ooyala.com/static/v4/production/latest/core.min.js"></script>
  <script src="//player.ooyala.com/static/v4/production/latest/video-plugin/main_html5.min.js"></script>
  <script src="//player.ooyala.com/static/v4/production/latest/video-plugin/bit_wrapper.min.js"></script>
  <!-- Change these html5-skin.min.css and html5-skin.min.js to your local build if necessary -->
  <script src="//player.ooyala.com/static/v4/production/latest/skin-plugin/html5-skin.min.js"></script>
  <link rel="stylesheet" href="//player.ooyala.com/static/v4/production/latest/skin-plugin/html5-skin.min.css"/>
</head>

<body>
<div id='container'></div>
<script>
  var playerParam = {
    "pcode": "YOUR_PCODE",
    "playerBrandingId": "YOUR_PLAYER_ID",
    "debug":true,
    "skin": {
      // config contains the configuration setting for player skin. Change to your local config when necessary.
      "config": ""
    }
  };

  OO.ready(function() {
    window.pp = OO.Player.create('container', 'RmZW4zcDo6KqkTIhn1LnowEZyUYn5Tb2', playerParam);
  });
</script>

</body>
</html>

Developer Setup

  1. Install git

  2. [Install Node.js] (https://nodejs.org/download/release/v8.11.3/) v8.11.3

  3. Install gulp globally by running: npm install --global gulp-cli

  4. Clone project: git clone https://github.com/ooyala/html5-skin.git

  5. After cloning, just cd in there, install dependencies by running npm install

  6. This project also makes use of git submodule for the config directory. This needs to be initialized using git submodule commands:

        git submodule init
        git submodule update
        git pull

    The init and update should only need to be run once, afterward git pull will update the submodule as well as the parent repo.

  7. Build the project by running: gulp

    This will perform an initial build and start a watch that will update the build/ folder with any changes made in js/ or scss/ folders.

    Once the app is built a webserver will start and serve sample.html in your browser http://0.0.0.0:4444/.

You can also use webpack-dev-server instead of gulp:

  1. Start dev-server by running: npm start

    This will start webpack dev-server in your browser http://localhost:4444/.

  2. Build the project by running: npm run build or npm run build-prod

    This will perform an initial build and start a watch that will update the build/ folder with any changes made in js/ or scss/ folders.

Style

We use Sass (SCSS) for CSS preprocessor.

Our 4-1 architecture pattern splits the Sass codebase over several files that are compiled into a single, minified stylesheet deployed to production.

This approach maintains modular, decoupled style without impacting performance.

scss/
|
|– base/
|   |– _normalize.scss   # makes browsers render elements more consistently
|   |– _reset.scss       # resets to common HTML elements, Adds additional rules on top of _normalize.scss
|   |– _variables.scss   # variables, colors, measurements, flags to enable/disable features
|   |– _base.scss        # boilerplate, app level styles
|   |– _type.scss        # typography rules, fonts, icons
|   ...
|
|– components/           # style to correspond to app views and components
|   |– _buttons.scss
|   |– _forms.scss
|   |– _[screen].scss
|   |– _[component].scss
|   ...
|
|– mixins/               # Sass tools and helpers used across project
|   |– _mixins.scss      # groups of reusable CSS functions
|   ...
|
|– skins/
|   |– _default.scss     # default skin, values pulled from /skin-plugin/config/skin.json
|   |– _alien.scss       # :alien: skin
|   ...
|
|
`– html5-skin.scss       # main Sass file

Testing

To run tests, run this command:

npm test

Add test files to directory tests/.

Test file should have same location and name as js/ file with -test after test file name.

For example, component file js/components/sharePanel.js will have test file tests/components/sharePanel-test.js.

Customization

Relative Paths

Note that some necessary files are located with relative paths. Please verify that those files are properly placed in your web application. This includes:

  • localization files
  • asset files

Simple Customization

Simple customization can be achieved by modifying skin.json settings. Furthermore, you are able to override skin setting during player create time. The example below hides description text and render playButton blue on start screen.

var playerParam = {
  "skin": {
    "config": "//player.ooyala.com/static/v4/production/latest/skin-plugin/skin.json",
    "inline": {
      "startScreen": {"showDescription": false, "playIconStyle": {"color": "blue"}}
    }
  }
};

Advanced Customization

Advanced customization is readily available by modifying JS files. Follow Developer Setup section to create a local repository and to run build script. Built files are available inside build folder. You are welcomed to host your built skin javascript to be run with your player.

How to Contribute

If you send a pull request, please do it against the master branch. We maintain stable branches separately but we don't accept pull requests to them directly.

We will do our best to keep the master branch in good shape, with tests passing at all times. But our master branch is under active development and may contain changes that your application might not be compatible with. We recommend using latest stable version for production.

Submitting a Pull Request

The core team monitors pull requests. We will review your pull request and either merge it, request changes to it, or close it with an explanation.

Before submitting a pull request, please make sure the following is done:

  1. Fork the repository and create your branch from master.

  2. If you've added code that should be tested, add tests!

  3. Ensure the test suite passes (npm test).

Style Guide

We mostly follow Airbnb's Style Guide.

html5-skin's People

Contributors

aeng7 avatar alexanderspb avatar alexeymohnatkin avatar brianfwong avatar chibzu avatar dallen42 avatar dchauooyala avatar dmitriimaslov avatar ipadilla4 avatar ivansakharovskii avatar jenkins-ooyala avatar jgkelle26 avatar jpfranco avatar jpfranco81 avatar knooyala avatar kseniiasokolovaepam avatar ksunika avatar marcosmx avatar mistermendez avatar mityaha avatar nzaitcev avatar nzaitcev-epam avatar ooyala-amohnatkin avatar paparajupavan avatar pilievooyala avatar rchalooyala avatar shruthi17 avatar tchangg avatar yvinokurov avatar zelibobla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

html5-skin's Issues

OO is not defined

I'm working on server side rendered reactJs App,when i setup Ooyala player console show bellow error

Uncaught ReferenceError: OO is not defined

closed captions in safari

In the skin options I have set
"closedCaptionOptions": {
"enabled" : false
},

But this will still display in Safari. The only way to hide it at the moment i to use css to hide it but why will the options above not work for safari ?

`npm install` fails with the latest node

Error occurs in building jest-cli with node 4.2.2:

$ npm install
npm WARN engine [email protected]: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"4.2.2","npm":"2.14.7"})

> [email protected] install /Users/kuu/html5-skin/node_modules/jest-cli/node_modules/jsdom/node_modules/contextify
> node-gyp rebuild

  CXX(target) Release/obj.target/contextify/src/contextify.o
In file included from ../src/contextify.cc:3:
../node_modules/nan/nan.h:261:25: error: redefinition of '_NanEnsureLocal'
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
...

No error occurs with node 0.12.7.

Nonlinear VPAID overlay ad container not visible

When an overlay ad is displayed, the container should be made visible and I can see this is attempted through the following style rule:
.oo-player-skin-plugins.oo-overlay-showing:not(:empty) { display: block; }

This is assigned when the overlay is showing and the container is 'not empty'. However, an additional line to update the z-index is also needed, as otherwise the container is obscured by the div with classes "oo-state-screen" and "oo-start-screen".

Please see the following PR for the suggested change: https://github.com/ooyala/html5-skin/pull/768/files

Example NonLinear Overlay test page: https://featured.dugout.com/preroll-test/coull.html

Closed captions changed via player javascript api does not change the skin state

I've recently came across this issue. When the player's closed captions language is changed via javaScript api method setClosedCaptionsLanguage, that does change the running cc language but does not update the skin's state.

As a result:

  • the new selected language is not reflected in CC language tab
  • The language change reverts when any skin event re-triggers the skin's setClosedCaptionsLanguage method and sets the language back to the stored language.

The problem is due to the fact that OO.EVENTS.SET_CLOSED_CAPTIONS_LANGUAGE is not subscribed in the skin code to update the internal state.

bitrate option fails to display on android for player v4.13.5

I'm using the followin encoding priority for my videos
['hls', 'dash', 'mp4'].

On a chrome desktop I see the option to change the bitrate but on all the android devices I have tested I am unable to get the bitrate icon to display. Earlier I had tried removing the mp4 option from the above array and it started to display. Now one hour later the bitrate option has disappeared.
This issue relates to chrome. I'm testing using Chrome 58 on android >= 4.4

Use Skin.defaultProps instead of a http request to a skin.json

I want to define all my parameter settings for the player skin in my 4.8.5/js/skin.js file in this repo but I am unable to get the values unless I give a value to the below parameter.

skin: {
 config: ''
}

Is there a way I can load the the defaultProps from skin.js instead of using the default process of getting the skin.json file. I want everything defined in the html5-skin instead of making an api call to the json file. Can someone point me in the right direction.

Much obliged

Watermark clickthrough not working

The use of a watermark clickUrl as documented here and here does not work. It simply does not turn the watermark into a link.

Using /v4/latest/

As a sidenote, why is it called a watermark when it is actually an icon and not at all a watermark?

deepmerge component not available

After upgrading html5-skin to 4.11.13/14 from 4.10.6, I get error of 'deepmerge is not a function'
I tried to isolate this issue and it seems if there is requirejs is on the page, then this specific error occur. I am not loading html5-skin or other ooyala player component via requirejs.
Same site work fine with 4.10.6
Exact console log error is:

Uncaught TypeError: DeepMerge is not a function at Html5Skin.loadConfigData (html5-skin.js:6306) at Html5Skin.<anonymous> (html5-skin.js:5727) at fire (core.js:2247) at Object.fireWith [as resolveWith] (core.js:2357) at done (core.js:9076) at XMLHttpRequest.callback (core.js:9791)

npm install fails with node v8.1 on Mac

The following error occurs in building contextify:

../src/contextify.cc:150:16: error: no member named 'SetAccessCheckCallbacks' in 'v8::ObjectTemplate'
        otmpl->SetAccessCheckCallbacks(GlobalPropertyNamedAccessCheck,
        ~~~~~  ^

Custom spinner loading parameter

I was doing some tests with player v4 and I wanted to change the "spinner loading" image and I realized that I need to modify directly the "js/components/spinner.js" file.
In my opinion it would be much better be able to modify this from the "skin config json" file that it was that I was searching on the documentation.

Self Hosting Player

Hi there,

I use to be able to self host the player files on my own server, using version 4.8.5. The issue I noticed with player 4.11.13 is that the bit_wrapper plugin fails to work on chrome and firefox when I self host. I have no issues with safari. Should I be including another file ?
The files that have been included are:

-video-plugin
-- main_html5.min.js
-- bit_wrapper.min.js
-- bitmovin.swf
-- bitmovinplayer-core.min.css
-- bitmovinplayer-core.min.js

Thanks in advance

Overrides Should Use Deep Merge

When you specify overrides through json and pass the parameters through createPlayer you have to define the entire base object or you get an error. For example:

If I wanted to change a button I couldn't do:

"buttons":{
   "desktopContent": [
       {"name": "playPause", "location":"moreOptions", "whenDoesNotFit":"drop", "minWidth": 45 }
     ]
}

Instead I have to include the whole button object as defined in the schema just to change one option. If you utilize Object.assign you can drastically cut down on the amount of JSON that has to be included when a developer wants to override a particular setting.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign

Export Player as a React component

Hi,

When using the player within React we are experiencing some issues (a PR is coming for one of them).

What would be cool is if this project also exported an NPM module that exported the skin as a react component so that it was possible to use it within an existing react installation like this:

... my react code

<OoyalaPlayer {...props} />

... some more code

This would make it much easier for us to embed the player and also it would keep us from having a react.mount() within a react.mount() call.

Have you tried / prototyped something like this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.