openplayerjs
Advanced tools
Comparing version 2.14.0 to 2.14.1
@@ -259,3 +259,6 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { | ||
item.position = pos || layer; | ||
if (item.position === 'right') { | ||
if (typeof item.index === 'number') { | ||
__classPrivateFieldGet(this, _Controls_items, "f")[item.position].splice(item.index, 0, item); | ||
} | ||
else if (item.position === 'right') { | ||
__classPrivateFieldGet(this, _Controls_items, "f")[item.position].unshift(item); | ||
@@ -327,3 +330,3 @@ } | ||
element.innerHTML = /\.(jpg|png|svg|gif)$/.test(item.icon) | ||
? `<img src="${sanitize(item.icon)}">` | ||
? `<img src="${sanitize(item.icon)}"${item.alt ? `alt="${sanitize(item.alt)}"` : ''}>` | ||
: sanitize(item.icon); | ||
@@ -352,3 +355,3 @@ } | ||
itemIcon = /\.(jpg|png|svg|gif)$/.test(s.icon) | ||
? `<img src="${sanitize(s.icon)}">` | ||
? `<img src="${sanitize(s.icon)}"${s.alt ? `alt="${sanitize(s.alt)}"` : ''}>` | ||
: sanitize(s.icon, false); | ||
@@ -355,0 +358,0 @@ } |
@@ -48,3 +48,2 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { | ||
__classPrivateFieldGet(this, _Progress_progress, "f").setAttribute('aria-valuenow', '0'); | ||
__classPrivateFieldGet(this, _Progress_progress, "f").setAttribute('aria-valuemax', '0'); | ||
__classPrivateFieldGet(this, _Progress_progress, "f").setAttribute('role', 'slider'); | ||
@@ -56,3 +55,2 @@ __classPrivateFieldSet(this, _Progress_slider, document.createElement('input'), "f"); | ||
__classPrivateFieldGet(this, _Progress_slider, "f").setAttribute('min', '0'); | ||
__classPrivateFieldGet(this, _Progress_slider, "f").setAttribute('max', '0'); | ||
__classPrivateFieldGet(this, _Progress_slider, "f").setAttribute('step', '0.1'); | ||
@@ -89,6 +87,8 @@ __classPrivateFieldGet(this, _Progress_slider, "f").value = '0'; | ||
!__classPrivateFieldGet(this, _Progress_player, "f").getElement().getAttribute('op-dvr__enabled')) { | ||
__classPrivateFieldGet(this, _Progress_slider, "f").setAttribute('max', `${el.duration}`); | ||
const current = __classPrivateFieldGet(this, _Progress_player, "f").isMedia() ? el.currentTime : el.duration - el.currentTime; | ||
__classPrivateFieldGet(this, _Progress_slider, "f").value = current.toString(); | ||
__classPrivateFieldGet(this, _Progress_progress, "f").setAttribute('aria-valuemax', el.duration.toString()); | ||
if (!Number.isNaN(el.duration)) { | ||
__classPrivateFieldGet(this, _Progress_slider, "f").setAttribute('max', `${el.duration}`); | ||
__classPrivateFieldGet(this, _Progress_progress, "f").setAttribute('aria-valuemax', el.duration.toString()); | ||
} | ||
} | ||
@@ -185,3 +185,5 @@ else if (__classPrivateFieldGet(this, _Progress_player, "f").getElement().getAttribute('op-dvr__enabled')) { | ||
parseFloat(__classPrivateFieldGet(this, _Progress_slider, "f").getAttribute('max') || '-1') !== el.duration) { | ||
__classPrivateFieldGet(this, _Progress_slider, "f").setAttribute('max', `${el.duration}`); | ||
if (!Number.isNaN(el.duration)) { | ||
__classPrivateFieldGet(this, _Progress_slider, "f").setAttribute('max', `${el.duration}`); | ||
} | ||
__classPrivateFieldGet(this, _Progress_progress, "f").setAttribute('aria-hidden', 'false'); | ||
@@ -213,4 +215,6 @@ } | ||
const current = __classPrivateFieldGet(this, _Progress_player, "f").isMedia() ? el.currentTime : el.duration - el.currentTime; | ||
__classPrivateFieldGet(this, _Progress_slider, "f").setAttribute('max', `${el.duration}`); | ||
__classPrivateFieldGet(this, _Progress_progress, "f").setAttribute('aria-valuemax', el.duration.toString()); | ||
if (!Number.isNaN(el.duration)) { | ||
__classPrivateFieldGet(this, _Progress_slider, "f").setAttribute('max', `${el.duration}`); | ||
__classPrivateFieldGet(this, _Progress_progress, "f").setAttribute('aria-valuemax', el.duration.toString()); | ||
} | ||
__classPrivateFieldGet(this, _Progress_played, "f").value = | ||
@@ -223,3 +227,5 @@ el.duration <= 0 || Number.isNaN(el.duration) || !Number.isFinite(el.duration) | ||
__classPrivateFieldGet(this, _Progress_slider, "f").style.backgroundSize = '0% 100%'; | ||
__classPrivateFieldGet(this, _Progress_slider, "f").setAttribute('max', '0'); | ||
if (__classPrivateFieldGet(this, _Progress_slider, "f").getAttribute('max')) { | ||
__classPrivateFieldGet(this, _Progress_slider, "f").setAttribute('max', '0'); | ||
} | ||
__classPrivateFieldGet(this, _Progress_buffer, "f").value = 0; | ||
@@ -226,0 +232,0 @@ __classPrivateFieldGet(this, _Progress_played, "f").value = 0; |
@@ -93,3 +93,2 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
if (!__classPrivateFieldGet(this, _Media_mediaLoaded, "f")) { | ||
__classPrivateFieldSet(this, _Media_mediaLoaded, true, "f"); | ||
yield this.load(); | ||
@@ -96,0 +95,0 @@ __classPrivateFieldSet(this, _Media_mediaLoaded, false, "f"); |
@@ -59,2 +59,3 @@ # NEW! Player Customizations | ||
title: '[TOOLTIP LABEL]', | ||
alt: '[ALT LABEL (mostly for IMG tags)]', | ||
type: '[button, div, span, p, etc.]', | ||
@@ -64,2 +65,3 @@ styles: {}, // Can add custom styles to element using camelCase styles (marginTop, boxShadow, etc.) | ||
position: 'right', // Any of the possible positions for a control (top, top-left, middle, bottom-right, etc.) | ||
index: 0, // Zero-index based position within the specificied place to set the element (useful when appending, prepending an item before an exisiting one) | ||
showInAds: false, // or true | ||
@@ -88,2 +90,4 @@ init: (player) => {}, // Pass an instance of the player for advanced operations | ||
title: '[TOOLTIP LABEL]', | ||
alt: '[ALT LABEL (mostly for IMG tags)]', | ||
index: 0, // Zero-index based position within the specificied place to set the element (useful when appending, prepending an item before an exisiting one) | ||
styles: {}, | ||
@@ -103,2 +107,3 @@ content: '', // Can override the content generated inside the control | ||
icon: '/path/to/item-image', // optional | ||
alt: '[ALT LABEL]', | ||
click: () => {}, | ||
@@ -105,0 +110,0 @@ }, |
{ | ||
"name": "openplayerjs", | ||
"version": "2.14.0", | ||
"version": "2.14.1", | ||
"homepage": "https://www.openplayerjs.com/", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -30,7 +30,7 @@ # [OpenPlayer.js](https://www.openplayerjs.com) | ||
| | | | | ||
| ------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| [![MedSims](https://img.medscapestatic.com/pi/global/icons/icon-medsims-logo@2x.png)](https://www.medscape.org/simulation) | [![Arrow Classic Rock](https://player.arrow.nl/tmp/images/logo.1507670326.jpg)](https://player.arrow.nl/ad.html) | [![Geração Rádios](https://user-images.githubusercontent.com/910829/168053773-8871dcf9-1f3a-4487-9f6d-95d4d461d945.png)](https://geracaoradios.com) | | ||
| [![LectureTube](https://live.video.tuwien.ac.at/room/assets/lecturetube_landscape.svg)](https://live.video.tuwien.ac.at/room/heart0/player.html) | [![Clippa](https://user-images.githubusercontent.com/910829/181409803-c9f25333-7c40-48fb-b54f-42f7e6f6537a.svg)](https://www.clippa.tv/bigKnightOut) | [![HitRadio Center](https://user-images.githubusercontent.com/910829/155380459-76856a41-5a19-4831-8ef8-6d0ae8d471f0.svg)](https://radiocenter.si) | | ||
| [![Rock Radio](https://user-images.githubusercontent.com/910829/155380461-9c74ff57-50a2-419c-b85a-dad8810b42c6.svg)](https://rockradio.si) | [![Chichester District Council](https://www.chichester.gov.uk/image/36146/Logo/logo.png?m=638182005245530000)](https://chichester.moderngov.co.uk/ieListDocuments.aspx?CId=134&MId=1620) | | | ||
| | | | | ||
| ------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| [![MedSims](https://img.medscapestatic.com/pi/global/icons/icon-medsims-logo@2x.png)](https://www.medscape.org/simulation) | [![Arrow Classic Rock](https://player.arrow.nl/tmp/images/logo.1507670326.jpg)](https://player.arrow.nl/ad.html) | [![Chichester District Council](https://www.chichester.gov.uk/image/36146/Logo/logo.png?m=638182005245530000)](https://chichester.moderngov.co.uk/ieListDocuments.aspx?CId=134&MId=1620) | | ||
| [![LectureTube](https://live.video.tuwien.ac.at/room/assets/lecturetube_landscape.svg)](https://live.video.tuwien.ac.at/room/heart0/player.html) | [![Clippa](https://user-images.githubusercontent.com/910829/181409803-c9f25333-7c40-48fb-b54f-42f7e6f6537a.svg)](https://www.clippa.tv/bigKnightOut) | [![HitRadio Center](https://user-images.githubusercontent.com/910829/155380459-76856a41-5a19-4831-8ef8-6d0ae8d471f0.svg)](https://radiocenter.si) | | ||
| [![Rock Radio](https://user-images.githubusercontent.com/910829/155380461-9c74ff57-50a2-419c-b85a-dad8810b42c6.svg)](https://rockradio.si) | | | | ||
@@ -37,0 +37,0 @@ ## Migrating from older version to new ones |
@@ -115,2 +115,3 @@ export interface Cue { | ||
layer?: 'top' | 'center' | 'bottom' | 'main' | string; | ||
index?: number; | ||
type: string; | ||
@@ -125,2 +126,3 @@ custom: boolean; | ||
icon?: string; | ||
alt?: string; | ||
click(): void; | ||
@@ -127,0 +129,0 @@ }[]; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
15228
1715268