From 9df52d660feb722404be00a50f3c8a612bec1c15 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 17 Aug 2021 14:42:53 +0200 Subject: Migrate client to eslint --- client/src/standalone/videos/test-embed.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'client/src/standalone/videos/test-embed.ts') diff --git a/client/src/standalone/videos/test-embed.ts b/client/src/standalone/videos/test-embed.ts index 6e035c0c9..066b3e024 100644 --- a/client/src/standalone/videos/test-embed.ts +++ b/client/src/standalone/videos/test-embed.ts @@ -4,11 +4,11 @@ import { PeerTubePlayer } from '../player/player' window.addEventListener('load', async () => { const urlParts = window.location.href.split('/') - const lastPart = urlParts[ urlParts.length - 1 ] + const lastPart = urlParts[urlParts.length - 1] const isPlaylist = window.location.pathname.startsWith('/video-playlists/') - const elementId = lastPart.indexOf('?') === -1 ? lastPart : lastPart.split('?')[ 0 ] + const elementId = lastPart.indexOf('?') === -1 ? lastPart : lastPart.split('?')[0] const iframe = document.createElement('iframe') iframe.src = isPlaylist @@ -18,14 +18,14 @@ window.addEventListener('load', async () => { const mainElement = document.querySelector('#host') mainElement.appendChild(iframe) - console.log(`Document finished loading.`) + console.log('Document finished loading.') const player = new PeerTubePlayer(document.querySelector('iframe')) - window[ 'player' ] = player + window['player'] = player - console.log(`Awaiting player ready...`) + console.log('Awaiting player ready...') await player.ready - console.log(`Player is ready.`) + console.log('Player is ready.') const monitoredEvents = [ 'pause', @@ -39,7 +39,9 @@ window.addEventListener('load', async () => { console.log(`PLAYER: now listening for event '${e}'`) player.getCurrentPosition() - .then(position => document.getElementById('playlist-position').innerHTML = position + '') + .then(position => { + document.getElementById('playlist-position').innerHTML = position + '' + }) }) let playbackRates: number[] = [] @@ -105,7 +107,7 @@ window.addEventListener('load', async () => { updateCaptions() - const updateResolutions = ((resolutions: PeerTubeResolution[]) => { + const updateResolutions = (resolutions: PeerTubeResolution[]) => { const resolutionListEl = document.querySelector('#resolution-list') resolutionListEl.innerHTML = '' @@ -126,7 +128,7 @@ window.addEventListener('load', async () => { resolutionListEl.appendChild(itemEl) } }) - }) + } player.getResolutions().then( resolutions => updateResolutions(resolutions)) -- cgit v1.2.3