All Projects → tapioca24 → videojs-logo

tapioca24 / videojs-logo

Licence: MIT license
A video.js plugin to display a logo image on the player. If you think it's good, give me a star! ⭐

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to videojs-logo

Videojs Youtube
YouTube playback technology for Video.js
Stars: ✭ 948 (+4889.47%)
Mutual labels:  videojs
Videojs Transcript
▶️📃 Interactive transcript plugin for video.js
Stars: ✭ 106 (+457.89%)
Mutual labels:  videojs
h5-qj
全景h5,商场活动,在商场场景下寻找企业LOGO展示优惠活动。
Stars: ✭ 18 (-5.26%)
Mutual labels:  videojs
Wjplayer
Video.js bundle that supports HLS, VAST/VMAP, 360-degree videos, and more.
Stars: ✭ 55 (+189.47%)
Mutual labels:  videojs
Larkplayer
🚀 A lightweight & flexible web player :)
Stars: ✭ 82 (+331.58%)
Mutual labels:  videojs
Videojs Hotkeys
Adds more hotkey support to video.js
Stars: ✭ 155 (+715.79%)
Mutual labels:  videojs
V Playback
A Vue2 plugin to make video play easier
Stars: ✭ 19 (+0%)
Mutual labels:  videojs
videojs-plus
An extension and skin for video.js
Stars: ✭ 49 (+157.89%)
Mutual labels:  videojs
Streaming Room
Streaming room in Node.js, rtmp, hsl, html5 videojs player
Stars: ✭ 106 (+457.89%)
Mutual labels:  videojs
media
Press kit / Media pack for OpenFaaS
Stars: ✭ 44 (+131.58%)
Mutual labels:  branding
React Awesome Player
🔥 video.js component for React
Stars: ✭ 56 (+194.74%)
Mutual labels:  videojs
Embed
Embed player for D.Tube
Stars: ✭ 65 (+242.11%)
Mutual labels:  videojs
Videojs Wavesurfer
video.js plugin that adds a navigable waveform for audio and video files
Stars: ✭ 242 (+1173.68%)
Mutual labels:  videojs
Videojscustomization
HTML5 视频播放器 自定制: React + video.js 详细讲解
Stars: ✭ 32 (+68.42%)
Mutual labels:  videojs
videojs-react-enhanced
React.js wrapper component for Video.js player
Stars: ✭ 37 (+94.74%)
Mutual labels:  videojs
Video.js
Video.js - open source HTML5 & Flash video player
Stars: ✭ 32,478 (+170836.84%)
Mutual labels:  videojs
Html5 Dash Hls Rtmp
🌻 HTML5播放器、M3U8直播/点播、RTMP直播、低延迟、推流/播流地址鉴权
Stars: ✭ 1,805 (+9400%)
Mutual labels:  videojs
react-hook-videojs
Easy React integration of Video.js using hooks.
Stars: ✭ 37 (+94.74%)
Mutual labels:  videojs
BRU-3
BRUTALISM logo generator
Stars: ✭ 18 (-5.26%)
Mutual labels:  branding
Videojs Contrib Hls
HLS library for video.js
Stars: ✭ 2,723 (+14231.58%)
Mutual labels:  videojs

videojs-logo

A video.js plugin to display a logo image on the player.

  • Abundant customization options
  • TypeScript support

video-js-logo-sample

If you think it's good, give me a star!

Table of Contents

Installation

Using npm:

npm install videojs-logo

Using yarn:

yarn add videojs-logo

Using jsDelivr CDN:

<script src="https://cdn.jsdelivr.net/npm/videojs-logo@latest/dist/videojs-logo.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/videojs-logo@latest/dist/videojs-logo.css">

Using unpkg CDN:

<script src="https://unpkg.com/videojs-logo@latest/dist/videojs-logo.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/videojs-logo@latest/dist/videojs-logo.css">

Usage

To include videojs-logo on your website or web application, use any of the following methods.

Script tag

This is the simplest case.
Get the script in whatever way you prefer and include the plugin after you include video.js, so that the videojs global is available.

<!-- include stylesheets -->
<link href="//path/to/video-js.min.css" rel="stylesheet">
<link href="//path/to/videojs-logo.css" rel="stylesheet">

<!-- include scripts -->
<script src="//path/to/video.min.js"></script>
<script src="//path/to/videojs-logo.min.js"></script>

<!-- initialize videojs-logo -->
<script>
  var player = videojs('my-video');

  player.logo({
    image: 'my_logo.png'
  });
</script>

ES Modules

Install videojs-logo via npm and import the plugin as you would any other module.
You will also need to import the stylesheet in some way.

import videojs from 'video.js';

// The actual plugin function is exported by this module, but it is also
// attached to the `Player.prototype`; so, there is no need to assign it
// to a variable.
import 'videojs-logo';
import 'videojs-logo/dist/videojs-logo.css';

const player = videojs('my-video');

player.logo({
  image: 'my_logo.png'
});

CommonJS

Install videojs-logo via npm and require the plugin as you would any other module.
You will also need to import the stylesheet in some way.

var videojs = require('video.js');

// The actual plugin function is exported by this module, but it is also
// attached to the `Player.prototype`; so, there is no need to assign it
// to a variable.
require('videojs-logo');
require('videojs-logo/dist/videojs-logo.css);

var player = videojs('my-video');

player.logo({
  image: 'my_logo.png'
});

TypeScript

When using with TypeScript, you can use the VideoJsLogo namespace.

import videojs, { VideoJsLogo } from 'video.js';
import 'videojs-logo';
import 'videojs-logo/dist/videojs-logo.css';

const player = videojs('my-video');

const options: VideoJsLogo.Options = {
  image: 'my_logo.png'
};
player.logo(options);

Configuration

Property Attributes Type Default value Description
image Required String The URL to the logo image.
url Optional String A url to be linked to from the logo. If the user clicks the logo the link will open in a new window.
position Optional String "top-right" The location to place the logo (top-left, top-right, bottom-left, or bottom-right).
offsetH Optional Number 0 Horizontal offset (px) from the edge of the video.
offsetV Optional Number 0 Vertical offset (px) from the edge of the video.
width Optional Number The width of the logo image (px). If not specified, it will be the width of the original image.
height Optional Number The height of the logo image (px). If not specified, it will be the height of the original image.
padding Optional Number 5 Padding around the logo image (px).
fadeDelay Optional Number, Null 5000 Time until fade-out begins (msec). If null is specified, automatic fade-out is not performed.
hideOnReady Optional Boolean false Do not show the logo image when the player is ready.
opacity Optional Boolean 1 The opacity of the logo (from [0, 1]). If not specified, it will default to 1.

Methods

You can also manually show / hide the logo image at any time.

// To show the logo image on the player's play event:
player.on('play', () => {
  player.logo().show();
});
Method Description
show() Show the logo image
hide() Hide the logo image

License

MIT. Copyright (c) tapioca24

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].