Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out a way to manage styles #16

Closed
thiagopnts opened this issue Feb 25, 2014 · 2 comments
Closed

Figure out a way to manage styles #16

thiagopnts opened this issue Feb 25, 2014 · 2 comments
Labels

Comments

@thiagopnts
Copy link
Member

We have to find a way to support css.

@thiagopnts
Copy link
Member Author

This is our current approach:

Given the following plugin structure,

src/plugins/spinner_three_bounce
├── index.js
└── public
    ├── spinner.css
    └── spinner.html

The index.js is the plugin's code. In the public/ directory is the plugins assets. We currently only support .css and .html files. The .html file supports underscore templating. These files are loaded during build, it's contents are extracted and parsed to a src/base/jst.js file, which exports a hash with all templating and styles, where the plugin's name is the key. So, for loading a plugins template, you must call it through JST['plugin_name']. To load a style, call JST.CSS['plugin_name']. This file must be used in development when referring to templates or styles. For example:

var JST = require('../../base/jst');
var FooPlugin = BaseObject.extend({
  template: JST['foo'],
  render: function() {
      this.style = JST.CSS['foo']; // here the style variable has all the css file content.
      return this;
  }
});

@thiagopnts
Copy link
Member Author

We also have to reset the style of all data attributes used by the player to avoid style collisions

jhonatangcavalcanti pushed a commit that referenced this issue May 2, 2024
House keeping the project dependencies
jhonatangcavalcanti pushed a commit that referenced this issue May 2, 2024
Custom listeners for HLS.js events
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants