Quick setup
Version 3 released
A new version 3.30.0 of Fluid Player has been released on Jan 11, 2024. Existing users that are using version 2 are recommended to upgrade to the latest version. See quick setup guide.
Initializer syntax
var player = fluidPlayer(target [, options]);
Fluid Player initializer accepts two arguments:
mandatory target. Can be a string HTML id of HTMLVideoElement or object reference to HTMLVideoElement.
options - optional, configuration object as documented in the configuration section of the documentation.
IMPORTANT: when referencing HTMLVideoElement by object reference, Fluid Player will mutate the element and assign a unique id to HTMLVideoElement unless the id is already set before initializer is invoked.
Integration using NPM
You can add Fluid Player to your NPM project using following commands. Execute them in the root of your software project (where package.json can be found).
Using NPM CLI
npm install fluid-player@^3.0.0
Using Yarn
yarn add fluid-player@^3.0.0
Using the Fluid Player module and importing CSS
To import Fluid player JavaScript module, place this code wherever you want Fluid Player to be accessible in code.
JavaScript
import fluidPlayer from 'fluid-player';
CSS
Depending on what kind of bundling mechanism used you will need to import CSS from NPM package to have player instances styled properly.
Refer to the documentation of your bundler to see how to add CSS to your stylesheets.
An example how the import might look like for Webpack projects using ~ as node_modules import prefix.
@import "~fluid-player/src/css/fluidplayer.css";
Integration using CDN
The Fluid Player provides a CDN build available for direct linking from https://cdn.fluidplayer.com.
IMPORTANT: As of v3.0.0, CDN version of Fluid Player ships with embedded CSS. Separate tag to include CSS is no longer required.
Automatically use the most recent version (recommended):
Or specify the version:
CDN integration example
Quality Switching
Multiple sources can be added as shown below. The title will be displayed to the user when switching sources, and should be set to the video quality as can be seen below ('1080p', '720p' etc).
Define Source as HD
The sources set for quality switching can be defined as HD by adding a data-fluid-hd attribute to the tag. The colour of this text will match the primary color. If you wish to override this colour you can do so using custom CSS on your own page. The class responsible for the colour is fp_hd_source. An example of overriding this colour is shown below.
.fp_hd_source { color: yellow !important; }
An example of how the HD is set in the sources is show below.
Setting additional options
Fluid Player can be customized by setting some optional parameters. The full list of parameters can be found under Configuration
kaisaya An bue mashigar Rafah don kai agaji ga fararen hula a Gaza Wannan shafi ne da ke kawo muku abubuwan da ke faruwa a Najeriya da sauran sassan duniya.
Comments
Post a Comment