Code Monkey home page Code Monkey logo

ltplayer's Introduction

LTPlayer

A video player made for LightTube.

Screenshots

screenshot

Usage

just import dist/player.min.js & dist/player.min.css into your HTML file, and then initialize the player with the following snippet:

<script>
	const player = new Player("video", {
		author: {
			icon: "URL of the author icon",
			title: "Name of the video author",
			href: "Link to the author's website"
		},
		title: "Title of the video",
		buttons: {
			// Icons for the control buttons. Accepts HTML.
			// It's recommended to use SVG icons.
			play: 'โ–ถ',
			pause: 'โธ',
			volumeMute: '๐Ÿ”‡',
			volumeLow: '๐Ÿ”ˆ',
			volumeMedium: '๐Ÿ”‰',
			volumeHigh: '๐Ÿ”Š',
			settings: 'โš™',
			fullscreen: '๐Ÿ”ณ',
			minimize: '๐Ÿ”ฒ'
		}
	});
</script>

Styling

You can use CSS variables to style parts of the player.

CSS Variable Description Default value
ltp-font Font used by the title, timestamp, menus etc. "sans-serif"
ltp-title-height Height of the title element 60px
ltp-top-gradient Top gradient of the player. linear-gradient(to bottom, #0005, #0000)
ltp-top-gradient-height Height of the top gradient. 100px
ltp-controls-height Height of the controls row. 40px
ltp-bottom-gradient Bottom gradient of the player. linear-gradient(to top, #0005, #0000)
ltp-bottom-gradient-height Height of the bottom gradient. 100px
ltp-progress-bar-background Video playback progress bar background. rgba(255, 255, 255, .2)
ltp-progress-bar-buffered Video playback buffered bar color. rgba(255, 255, 255, .4)
ltp-progress-bar-hover Video playback hover bar color. rgba(255, 255, 255, .5)
ltp-progress-bar-played Video playback played bar color. #F00
ltp-volume-bar-background Volume bar background. rgba(255, 255, 255, .2)
ltp-volume-bar-color Volume bar color. #fff
ltp-menu-background Menu background. rgba(28, 28, 28, .9)
ltp-menu-hover Menu item hover color. rgba(72, 72, 72, .9)
ltp-menu-text Menu item text color. #fff
ltp-storyboard-background Background of the storyboard. rgba(72, 72, 72, .9);
ltp-time-popup-text Text color of the popup time text. #fff
ltp-time-popup-background Background color of the popup time text. rgba(28, 28, 28, .9);
ltp-skip-background Background color of the skip button. #0007
ltp-skip-text Background color of the skip button text. #ccc
ltp-skip-border Border of the skip button. 1px solid #ccc
ltp-skip-hover-background Background color of the hovered skip button. #0009
ltp-skip-hover-text Background color of the hovered skip button text. #fff
ltp-skip-hover-border Border of the hovered skip button. 1px solid #fff
ltp-endscreen-item-background Background color of the endscreen cards #ccc
ltp-endscreen-item-title Endscreen card title text color #fff
ltp-endscreen-item-subtitle Endscreen card subtitle text color #ddd

Todo list

[x] HLS Playback
[x] Subtitles (by user agent)
[ ] Subtitles (custom, style-able)
[x] Hotkeys
[x] Preview thumbnails (storyboards)
[ ] High quality preview thumbnails (YouTube L2)
[x] Endcards
[x] Playback Segments

ltplayer's People

Contributors

kuylar avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

inftord kuylar

ltplayer's Issues

Video controls aren't visible on safari

Video controls aren't visible on safari, they can be interacted with, however they appear to be invisible.

Safari Version 17.4.1 (19618.1.15.11.14)
MacOS 14.4.1 (23E224)

Timestamp conversion is broken

Instead of 32:28, it displays 1:32:28, minutes are also borked (instead of 1:00:28 it displays 1:60:28, instead of 1:01:xx it displays 1:00:xx and so on)

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.