12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060 |
- <template>
- <div>
- <metadata v-if="exists && !loading" :title="`${station.displayName}`" />
- <metadata v-else-if="!exists && !loading" :title="`Not found`" />
- <station-header
- v-if="exists"
- :class="{ 'header-sidebar-active': sidebarActive }"
- />
- <div class="station-parent">
- <div v-show="loading" class="progress" />
- <div v-show="!loading && exists" class="station">
- <div v-show="noSong" class="no-song">
- <h1>No song is currently playing</h1>
- <h4
- v-if="
- station.type === 'community' &&
- station.partyMode &&
- this.loggedIn &&
- (!station.locked ||
- (station.locked &&
- this.userId === station.owner))
- "
- >
- <a
- href="#"
- class="no-song"
- @click="
- openModal({
- sector: 'station',
- modal: 'addSongToQueue'
- })
- "
- >Add a song to the queue</a
- >
- </h4>
- <h4
- v-if="
- station.type === 'community' &&
- !station.partyMode &&
- this.userId === station.owner &&
- !station.privatePlaylist
- "
- >
- <a
- href="#"
- class="no-song"
- @click="
- openModal({
- sector: 'station',
- modal: 'editStation'
- })
- "
- >Play a private playlist</a
- >
- </h4>
- <h1
- v-if="
- station.type === 'community' &&
- !station.partyMode &&
- this.userId === station.owner &&
- station.privatePlaylist
- "
- >
- Maybe you can add some songs to your selected private
- playlist and then press the skip button
- </h1>
- </div>
- <div v-show="!noSong" class="columns">
- <div
- class="column is-8-desktop is-offset-2-desktop is-12-mobile"
- >
- <div class="video-container">
- <div id="player" />
- <div
- class="player-can-not-autoplay"
- v-if="!canAutoplay"
- >
- <p>
- Please click anywhere on the screen for the
- video to start
- </p>
- </div>
- </div>
- <div
- id="preview-progress"
- class="seeker-bar-container white"
- >
- <div
- class="seeker-bar light-blue"
- style="width: 0%"
- />
- </div>
- </div>
- <div
- class="desktop-only column is-3-desktop card playlistCard experimental"
- >
- <div v-if="station.type === 'community'" class="title">
- Queue
- </div>
- <div v-else class="title">
- Playlist
- </div>
- <article v-if="!noSong" class="media">
- <figure class="media-left">
- <p class="image is-64x64">
- <img
- :src="currentSong.thumbnail"
- onerror="this.src='/assets/notes-transparent.png'"
- />
- </p>
- </figure>
- <div class="media-content">
- <div class="content">
- <p>
- Current Song:
- <br />
- <strong>{{ currentSong.title }}</strong>
- <br />
- <small>{{ currentSong.artists }}</small>
- </p>
- </div>
- </div>
- <div class="media-right">
- {{ utils.formatTime(currentSong.duration) }}
- </div>
- </article>
- <p v-if="noSong" class="has-text-centered">
- There is currently no song playing.
- </p>
- <article
- v-for="(song, index) in songsList"
- :key="index"
- class="media"
- >
- <div class="media-content">
- <div class="content">
- <strong class="songTitle">{{
- song.title
- }}</strong>
- <br />
- <small>{{ song.artists.join(", ") }}</small>
- <br />
- <div v-if="station.partyMode">
- <br />
- <small>
- Requested by
- <b>
- <user-id-to-username
- :user-id="song.requestedBy"
- :link="true"
- />
- </b>
- </small>
- <button
- v-if="
- isOwnerOnly() || isAdminOnly()
- "
- class="button"
- @click="
- removeFromQueue(song.songId)
- "
- >
- REMOVE
- </button>
- </div>
- </div>
- </div>
- <div class="media-right">
- {{ utils.formatTime(song.duration) }}
- </div>
- </article>
- <a
- v-if="station.type === 'community' && loggedIn"
- class="button add-to-queue"
- href="#"
- @click="
- openModal({
- sector: 'station',
- modal: 'addSongToQueue'
- })
- "
- >Add a song to the queue</a
- >
- </div>
- </div>
- <div v-show="!noSong" class="desktop-only columns is-mobile">
- <div
- class="column is-8-desktop is-offset-2-desktop is-12-mobile"
- >
- <div class="columns is-mobile">
- <div class="column is-12-desktop">
- <h4 id="time-display">
- {{ timeElapsed }} /
- {{ utils.formatTime(currentSong.duration) }}
- </h4>
- <h3>{{ currentSong.title }}</h3>
- <h4 class="thin" style="margin-left: 0">
- {{ currentSong.artists }}
- </h4>
- <div class="columns is-mobile">
- <form
- style="margin-top: 12px; margin-bottom: 0"
- action="#"
- class="column is-7-desktop is-4-mobile"
- >
- <p class="volume-slider-wrapper">
- <i
- v-if="muted"
- class="material-icons"
- @click="toggleMute()"
- >volume_mute</i
- >
- <i
- v-else
- class="material-icons"
- @click="toggleMute()"
- >volume_down</i
- >
- <input
- v-model="volumeSliderValue"
- type="range"
- min="0"
- max="10000"
- class="volumeSlider active"
- @change="changeVolume()"
- @input="changeVolume()"
- />
- <i
- class="material-icons"
- @click="increaseVolume()"
- >volume_up</i
- >
- </p>
- </form>
- <div
- class="column is-8-mobile is-5-desktop"
- >
- <ul
- v-if="
- currentSong.likes !== -1 &&
- currentSong.dislikes !== -1
- "
- id="ratings"
- >
- <li
- id="like"
- style="margin-right: 10px"
- @click="toggleLike()"
- >
- <span class="flow-text">{{
- currentSong.likes
- }}</span>
- <i
- id="thumbs_up"
- class="material-icons grey-text"
- :class="{ liked: liked }"
- >thumb_up</i
- >
- <a
- class="absolute-a behind"
- href="#"
- @click="toggleLike()"
- />
- </li>
- <li
- id="dislike"
- @click="toggleDislike()"
- >
- <span class="flow-text">{{
- currentSong.dislikes
- }}</span>
- <i
- id="thumbs_down"
- class="material-icons grey-text"
- :class="{
- disliked: disliked
- }"
- >thumb_down</i
- >
- <a
- class="absolute-a behind"
- href="#"
- @click="toggleDislike()"
- />
- </li>
- </ul>
- </div>
- </div>
- </div>
- <div
- v-if="!currentSong.simpleSong"
- class="column is-3-desktop experimental"
- >
- <img
- class="image"
- :src="currentSong.thumbnail"
- alt="Song Thumbnail"
- onerror="this.src='/assets/notes-transparent.png'"
- />
- </div>
- </div>
- </div>
- </div>
- <div v-show="!noSong" class="mobile-only">
- <div>
- <div>
- <div>
- <h3>{{ currentSong.title }}</h3>
- <h4 class="thin">
- {{ currentSong.artists }}
- </h4>
- <h5>
- {{ timeElapsed }} /
- {{ utils.formatTime(currentSong.duration) }}
- </h5>
- <div>
- <form class="columns" action="#">
- <p
- class="column is-11-mobile volume-slider-wrapper"
- >
- <i
- v-if="muted"
- class="material-icons"
- @click="toggleMute()"
- >volume_mute</i
- >
- <i
- v-else
- class="material-icons"
- @click="toggleMute()"
- >volume_down</i
- >
- <input
- v-model="volumeSliderValue"
- type="range"
- min="0"
- max="10000"
- class="active volumeSlider"
- @change="changeVolume()"
- @input="changeVolume()"
- />
- <i
- class="material-icons"
- @click="increaseVolume()"
- >volume_up</i
- >
- </p>
- </form>
- <div>
- <ul
- v-if="
- currentSong.likes !== -1 &&
- currentSong.dislikes !== -1
- "
- id="ratings"
- style="display: inline-block"
- >
- <li
- id="dislike"
- style="display: inline-block;margin-right: 10px;"
- @click="toggleDislike()"
- >
- <span class="flow-text">{{
- currentSong.dislikes
- }}</span>
- <i
- id="thumbs_down"
- class="material-icons grey-text"
- :class="{
- disliked: disliked
- }"
- >thumb_down</i
- >
- <a
- class="absolute-a behind"
- href="#"
- @click="toggleDislike()"
- />
- </li>
- <li
- id="like"
- style="display: inline-block"
- @click="toggleLike()"
- >
- <span class="flow-text">{{
- currentSong.likes
- }}</span>
- <i
- id="thumbs_up"
- class="material-icons grey-text"
- :class="{ liked: liked }"
- >thumb_up</i
- >
- <a
- class="absolute-a behind"
- href="#"
- @click="toggleLike()"
- />
- </li>
- </ul>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <song-queue v-if="modals.addSongToQueue" />
- <add-to-playlist v-if="modals.addSongToPlaylist" />
- <edit-playlist v-if="modals.editPlaylist" />
- <create-playlist v-if="modals.createPlaylist" />
- <edit-station v-if="modals.editStation" store="station" />
- <report v-if="modals.report" />
- <transition name="slide-outer">
- <div class="sidebar-container" v-if="sidebarActive">
- <transition name="slide-inner">
- <songs-list-sidebar v-if="sidebars.songslist" />
- </transition>
- <transition name="slide-inner">
- <users-sidebar v-if="sidebars.users" />
- </transition>
- </div>
- </transition>
- </div>
- <floating-box id="playerDebugBox" ref="playerDebugBox">
- <template #body>
- <span><b>YouTube id</b>: {{ currentSong.songId }}</span>
- <span><b>Duration</b>: {{ currentSong.duration }}</span>
- <span
- ><b>Skip duration</b>: {{ currentSong.skipDuration }}</span
- >
- <span><b>Can autoplay</b>: {{ canAutoplay }}</span>
- <span
- ><b>Attempts to play video</b>:
- {{ attemptsToPlayVideo }}</span
- >
- <span
- ><b>Last time requested if can autoplay</b>:
- {{ lastTimeRequestedIfCanAutoplay }}</span
- >
- <span><b>Loading</b>: {{ loading }}</span>
- <span><b>Playback rate</b>: {{ playbackRate }}</span>
- <span><b>Player ready</b>: {{ playerReady }}</span>
- <span><b>Ready</b>: {{ ready }}</span>
- <span><b>Seeking</b>: {{ seeking }}</span>
- <span><b>System difference</b>: {{ systemDifference }}</span>
- <span><b>Time before paused</b>: {{ timeBeforePause }}</span>
- <span><b>Time elapsed</b>: {{ timeElapsed }}</span>
- <span><b>Time paused</b>: {{ timePaused }}</span>
- <span><b>Volume slider value</b>: {{ volumeSliderValue }}</span>
- <span><b>Local paused</b>: {{ localPaused }}</span>
- <span><b>No song</b>: {{ noSong }}</span>
- <span
- ><b>Private playlist queue selected</b>:
- {{ privatePlaylistQueueSelected }}</span
- >
- <span><b>Station paused</b>: {{ stationPaused }}</span>
- </template>
- </floating-box>
- <Z404 v-if="!exists"></Z404>
- </div>
- </template>
- <script>
- import { mapState, mapActions } from "vuex";
- import Toast from "toasters";
- import StationHeader from "./StationHeader.vue";
- import UserIdToUsername from "../../components/common/UserIdToUsername.vue";
- import Z404 from "../404.vue";
- import FloatingBox from "../../components/ui/FloatingBox.vue";
- import io from "../../io";
- import keyboardShortcuts from "../../keyboardShortcuts";
- import utils from "../../../js/utils";
- export default {
- data() {
- return {
- utils,
- title: "Station",
- loading: true,
- ready: false,
- exists: true,
- playerReady: false,
- player: undefined,
- timePaused: 0,
- muted: false,
- timeElapsed: "0:00",
- liked: false,
- disliked: false,
- timeBeforePause: 0,
- skipVotes: 0,
- automaticallyRequestedSongId: null,
- systemDifference: 0,
- attemptsToPlayVideo: 0,
- canAutoplay: true,
- lastTimeRequestedIfCanAutoplay: 0,
- seeking: false,
- playbackRate: 1,
- volumeSliderValue: 0
- };
- },
- computed: {
- ...mapState("modals", {
- modals: state => state.modals.station
- }),
- ...mapState("sidebars", {
- sidebars: state => state.sidebars.station
- }),
- ...mapState("station", {
- station: state => state.station,
- currentSong: state => state.currentSong,
- songsList: state => state.songsList,
- stationPaused: state => state.stationPaused,
- localPaused: state => state.localPaused,
- noSong: state => state.noSong,
- privatePlaylistQueueSelected: state =>
- state.privatePlaylistQueueSelected
- }),
- ...mapState({
- loggedIn: state => state.user.auth.loggedIn,
- userId: state => state.user.auth.userId,
- role: state => state.user.auth.role
- }),
- sidebarActive() {
- return Object.values(this.sidebars).indexOf(true) !== -1;
- }
- },
- methods: {
- isOwnerOnly() {
- return this.loggedIn && this.userId === this.station.owner;
- },
- isAdminOnly() {
- return this.loggedIn && this.role === "admin";
- },
- isOwnerOrAdmin() {
- return this.isOwnerOnly() || this.isAdminOnly();
- },
- removeFromQueue(songId) {
- window.socket.emit(
- "stations.removeFromQueue",
- this.station._id,
- songId,
- res => {
- if (res.status === "success") {
- new Toast({
- content:
- "Successfully removed song from the queue.",
- timeout: 4000
- });
- } else new Toast({ content: res.message, timeout: 8000 });
- }
- );
- },
- youtubeReady() {
- if (!this.player) {
- this.player = new window.YT.Player("player", {
- height: 270,
- width: 480,
- videoId: this.currentSong.songId,
- host: "https://www.youtube-nocookie.com",
- startSeconds:
- this.getTimeElapsed() / 1000 +
- this.currentSong.skipDuration,
- playerVars: {
- controls: 0,
- iv_load_policy: 3,
- rel: 0,
- showinfo: 0
- },
- events: {
- onReady: () => {
- this.playerReady = true;
- let volume = parseInt(
- localStorage.getItem("volume")
- );
- volume = typeof volume === "number" ? volume : 20;
- this.player.setVolume(volume);
- if (volume > 0) {
- this.player.unMute();
- }
- if (this.muted) this.player.mute();
- this.playVideo();
- },
- onError: err => {
- console.log("iframe error", err);
- if (this.loggedIn) this.voteSkipStation();
- },
- onStateChange: event => {
- if (
- event.data === window.YT.PlayerState.PLAYING &&
- this.videoLoading === true
- ) {
- this.videoLoading = false;
- this.player.seekTo(
- this.getTimeElapsed() / 1000 +
- this.currentSong.skipDuration,
- true
- );
- if (this.localPaused || this.stationPaused)
- this.player.pauseVideo();
- } else if (
- event.data === window.YT.PlayerState.PLAYING &&
- (this.localPaused || this.stationPaused)
- ) {
- this.player.seekTo(
- this.timeBeforePause / 1000,
- true
- );
- this.player.pauseVideo();
- } else if (
- event.data === window.YT.PlayerState.PLAYING &&
- this.seeking === true
- ) {
- this.seeking = false;
- }
- if (
- event.data === window.YT.PlayerState.PAUSED &&
- !this.localPaused &&
- !this.stationPaused &&
- !this.noSong &&
- this.player.getDuration() / 1000 <
- this.currentSong.duration
- ) {
- this.player.seekTo(
- this.getTimeElapsed() / 1000 +
- this.currentSong.skipDuration,
- true
- );
- this.player.playVideo();
- }
- }
- }
- });
- }
- },
- getTimeElapsed() {
- if (this.currentSong) {
- let { timePaused } = this;
- if (this.stationPaused)
- timePaused += Date.currently() - this.pausedAt;
- return Date.currently() - this.startedAt - timePaused;
- }
- return 0;
- },
- playVideo() {
- if (this.playerReady) {
- this.videoLoading = true;
- this.player.loadVideoById(
- this.currentSong.songId,
- this.getTimeElapsed() / 1000 + this.currentSong.skipDuration
- );
- if (window.stationInterval !== 0)
- clearInterval(window.stationInterval);
- window.stationInterval = setInterval(() => {
- this.resizeSeekerbar();
- this.calculateTimeElapsed();
- }, 150);
- }
- },
- resizeSeekerbar() {
- if (!this.stationPaused) {
- document.getElementsByClassName(
- "seeker-bar"
- )[0].style.width = `${parseFloat(
- (this.getTimeElapsed() / 1000 / this.currentSong.duration) *
- 100
- )}%`;
- }
- },
- calculateTimeElapsed() {
- if (
- this.playerReady &&
- this.currentSong &&
- this.player.getPlayerState() === -1
- ) {
- if (this.attemptsToPlayVideo >= 5) {
- if (
- Date.now() - this.lastTimeRequestedIfCanAutoplay >
- 2000
- ) {
- this.lastTimeRequestedIfCanAutoplay = Date.now();
- window.canAutoplay.video().then(({ result }) => {
- if (result) {
- this.attemptsToPlayVideo = 0;
- this.canAutoplay = true;
- } else {
- this.canAutoplay = false;
- }
- });
- }
- } else {
- this.player.playVideo();
- this.attemptsToPlayVideo += 1;
- }
- }
- if (!this.stationPaused && !this.localPaused) {
- const timeElapsed = this.getTimeElapsed();
- const currentPlayerTime =
- Math.max(
- this.player.getCurrentTime() -
- this.currentSong.skipDuration,
- 0
- ) * 1000;
- const difference = timeElapsed - currentPlayerTime;
- // console.log(difference);
- let playbackRate = 1;
- if (difference < -2000) {
- if (!this.seeking) {
- this.seeking = true;
- this.player.seekTo(
- this.getTimeElapsed() / 1000 +
- this.currentSong.skipDuration
- );
- }
- } else if (difference < -200) {
- // console.log("Difference0.8");
- playbackRate = 0.8;
- } else if (difference < -50) {
- // console.log("Difference0.9");
- playbackRate = 0.9;
- } else if (difference < -25) {
- // console.log("Difference0.99");
- playbackRate = 0.95;
- } else if (difference > 2000) {
- if (!this.seeking) {
- this.seeking = true;
- this.player.seekTo(
- this.getTimeElapsed() / 1000 +
- this.currentSong.skipDuration
- );
- }
- } else if (difference > 200) {
- // console.log("Difference1.2");
- playbackRate = 1.2;
- } else if (difference > 50) {
- // console.log("Difference1.1");
- playbackRate = 1.1;
- } else if (difference > 25) {
- // console.log("Difference1.01");
- playbackRate = 1.05;
- } else if (this.player.getPlaybackRate !== 1.0) {
- // console.log("NDifference1.0");
- this.player.setPlaybackRate(1.0);
- }
- if (this.playbackRate !== playbackRate) {
- this.player.setPlaybackRate(playbackRate);
- this.playbackRate = playbackRate;
- }
- }
- /* if (this.currentTime !== undefined && this.paused) {
- this.timePaused += Date.currently() - this.currentTime;
- this.currentTime = undefined;
- } */
- let { timePaused } = this;
- if (this.stationPaused)
- timePaused += Date.currently() - this.pausedAt;
- const duration =
- (Date.currently() - this.startedAt - timePaused) / 1000;
- const songDuration = this.currentSong.duration;
- if (songDuration <= duration) this.player.pauseVideo();
- if (!this.stationPaused && duration <= songDuration)
- this.timeElapsed = utils.formatTime(duration);
- },
- toggleLock() {
- window.socket.emit("stations.toggleLock", this.station._id, res => {
- if (res.status === "success") {
- new Toast({
- content: "Successfully toggled the queue lock.",
- timeout: 4000
- });
- } else new Toast({ content: res.message, timeout: 8000 });
- });
- },
- changeVolume() {
- const volume = this.volumeSliderValue;
- localStorage.setItem("volume", volume / 100);
- if (this.playerReady) {
- this.player.setVolume(volume / 100);
- if (volume > 0) {
- this.player.unMute();
- localStorage.setItem("muted", false);
- this.muted = false;
- }
- }
- },
- resumeLocalStation() {
- this.updateLocalPaused(false);
- if (!this.stationPaused) this.resumeLocalPlayer();
- },
- pauseLocalStation() {
- this.updateLocalPaused(true);
- this.pauseLocalPlayer();
- },
- resumeLocalPlayer() {
- if (!this.noSong) {
- if (this.playerReady) {
- this.player.seekTo(
- this.getTimeElapsed() / 1000 +
- this.currentSong.skipDuration
- );
- this.player.playVideo();
- }
- }
- },
- pauseLocalPlayer() {
- if (!this.noSong) {
- this.timeBeforePause = this.getTimeElapsed();
- if (this.playerReady) this.player.pauseVideo();
- }
- },
- skipStation() {
- this.socket.emit("stations.forceSkip", this.station._id, data => {
- if (data.status !== "success")
- new Toast({
- content: `Error: ${data.message}`,
- timeout: 8000
- });
- else
- new Toast({
- content:
- "Successfully skipped the station's current song.",
- timeout: 4000
- });
- });
- },
- voteSkipStation() {
- this.socket.emit("stations.voteSkip", this.station._id, data => {
- if (data.status !== "success")
- new Toast({
- content: `Error: ${data.message}`,
- timeout: 8000
- });
- else
- new Toast({
- content: "Successfully voted to skip the current song.",
- timeout: 4000
- });
- });
- },
- resumeStation() {
- this.socket.emit("stations.resume", this.station._id, data => {
- if (data.status !== "success")
- new Toast({
- content: `Error: ${data.message}`,
- timeout: 8000
- });
- else
- new Toast({
- content: "Successfully resumed the station.",
- timeout: 4000
- });
- });
- },
- pauseStation() {
- this.socket.emit("stations.pause", this.station._id, data => {
- if (data.status !== "success")
- new Toast({
- content: `Error: ${data.message}`,
- timeout: 8000
- });
- else
- new Toast({
- content: "Successfully paused the station.",
- timeout: 4000
- });
- });
- },
- toggleMute() {
- if (this.playerReady) {
- const previousVolume = parseFloat(
- localStorage.getItem("volume")
- );
- const volume =
- this.player.getVolume() * 100 <= 0 ? previousVolume : 0;
- this.muted = !this.muted;
- localStorage.setItem("muted", this.muted);
- this.volumeSliderValue = volume * 100;
- this.player.setVolume(volume);
- if (!this.muted) localStorage.setItem("volume", volume);
- }
- },
- increaseVolume() {
- if (this.playerReady) {
- const previousVolume = parseInt(localStorage.getItem("volume"));
- let volume = previousVolume + 5;
- if (previousVolume === 0) {
- this.muted = false;
- localStorage.setItem("muted", false);
- }
- if (volume > 100) volume = 100;
- this.volumeSliderValue = volume * 100;
- this.player.setVolume(volume);
- localStorage.setItem("volume", volume);
- }
- },
- toggleLike() {
- if (this.liked)
- this.socket.emit(
- "songs.unlike",
- this.currentSong.songId,
- data => {
- if (data.status !== "success")
- new Toast({
- content: `Error: ${data.message}`,
- timeout: 8000
- });
- }
- );
- else
- this.socket.emit(
- "songs.like",
- this.currentSong.songId,
- data => {
- if (data.status !== "success")
- new Toast({
- content: `Error: ${data.message}`,
- timeout: 8000
- });
- }
- );
- },
- toggleDislike() {
- if (this.disliked)
- return this.socket.emit(
- "songs.undislike",
- this.currentSong.songId,
- data => {
- if (data.status !== "success")
- new Toast({
- content: `Error: ${data.message}`,
- timeout: 8000
- });
- }
- );
- return this.socket.emit(
- "songs.dislike",
- this.currentSong.songId,
- data => {
- if (data.status !== "success")
- new Toast({
- content: `Error: ${data.message}`,
- timeout: 8000
- });
- }
- );
- },
- addFirstPrivatePlaylistSongToQueue() {
- let isInQueue = false;
- if (
- this.station.type === "community" &&
- this.station.partyMode === true
- ) {
- this.songsList.forEach(queueSong => {
- if (queueSong.requestedBy === this.userId) isInQueue = true;
- });
- if (!isInQueue && this.privatePlaylistQueueSelected) {
- this.socket.emit(
- "playlists.getFirstSong",
- this.privatePlaylistQueueSelected,
- data => {
- if (data.status === "success") {
- if (data.song) {
- if (data.song.duration < 15 * 60) {
- this.automaticallyRequestedSongId =
- data.song.songId;
- this.socket.emit(
- "stations.addToQueue",
- this.station._id,
- data.song.songId,
- data2 => {
- if (
- data2.status === "success"
- ) {
- this.socket.emit(
- "playlists.moveSongToBottom",
- this
- .privatePlaylistQueueSelected,
- data.song.songId,
- data3 => {
- if (
- data3.status ===
- "success"
- ) {
- console.log(
- "This comment is just here because of eslint/prettier issues, ignore it"
- );
- }
- }
- );
- }
- }
- );
- } else {
- new Toast({
- content: `Top song in playlist was too long to be added.`,
- timeout: 3000
- });
- this.socket.emit(
- "playlists.moveSongToBottom",
- this.privatePlaylistQueueSelected,
- data.song.songId,
- data3 => {
- if (
- data3.status === "success"
- ) {
- setTimeout(() => {
- this.addFirstPrivatePlaylistSongToQueue();
- }, 3000);
- }
- }
- );
- }
- } else {
- new Toast({
- content: `Selected playlist has no songs.`,
- timeout: 4000
- });
- }
- }
- }
- );
- }
- }
- },
- togglePlayerDebugBox() {
- this.$refs.playerDebugBox.toggleBox();
- },
- resetPlayerDebugBox() {
- this.$refs.playerDebugBox.resetBox();
- },
- join() {
- this.socket.emit("stations.join", this.stationName, res => {
- console.log(res.data);
- if (res.status === "success") {
- this.loading = false;
- const {
- _id,
- displayName,
- description,
- privacy,
- locked,
- partyMode,
- owner,
- privatePlaylist,
- type
- } = res.data;
- this.joinStation({
- _id,
- name: this.stationName,
- displayName,
- description,
- privacy,
- locked,
- partyMode,
- owner,
- privatePlaylist,
- type
- });
- const currentSong = res.data.currentSong
- ? res.data.currentSong
- : {};
- if (currentSong.artists)
- currentSong.artists = currentSong.artists.join(", ");
- this.updateCurrentSong(currentSong);
- this.startedAt = res.data.startedAt;
- this.updateStationPaused(res.data.paused);
- this.timePaused = res.data.timePaused;
- this.updateUserCount(res.data.userCount);
- this.updateUsers(res.data.users);
- this.pausedAt = res.data.pausedAt;
- if (res.data.currentSong) {
- this.updateNoSong(false);
- this.youtubeReady();
- this.playVideo();
- this.socket.emit(
- "songs.getOwnSongRatings",
- res.data.currentSong.songId,
- data => {
- if (this.currentSong.songId === data.songId) {
- this.liked = data.liked;
- this.disliked = data.disliked;
- }
- }
- );
- } else {
- if (this.playerReady) this.player.pauseVideo();
- this.updateNoSong(true);
- }
- if (type === "community" && partyMode === true) {
- this.socket.emit("stations.getQueue", _id, res => {
- if (res.status === "success") {
- this.updateSongsList(res.queue);
- }
- });
- }
- if (this.isOwnerOrAdmin()) {
- keyboardShortcuts.registerShortcut(
- "station.pauseResume",
- {
- keyCode: 32,
- shift: false,
- ctrl: true,
- handler: () => {
- if (this.stationPaused)
- this.resumeStation();
- else this.pauseStation();
- }
- }
- );
- keyboardShortcuts.registerShortcut(
- "station.skipStation",
- {
- keyCode: 39,
- shift: false,
- ctrl: true,
- handler: () => {
- this.skipStation();
- }
- }
- );
- }
- keyboardShortcuts.registerShortcut(
- "station.lowerVolumeLarge",
- {
- keyCode: 40,
- shift: false,
- ctrl: true,
- handler: () => {
- this.volumeSliderValue -= 1000;
- this.changeVolume();
- }
- }
- );
- keyboardShortcuts.registerShortcut(
- "station.lowerVolumeSmall",
- {
- keyCode: 40,
- shift: true,
- ctrl: true,
- handler: () => {
- this.volumeSliderValue -= 100;
- this.changeVolume();
- }
- }
- );
- keyboardShortcuts.registerShortcut(
- "station.increaseVolumeLarge",
- {
- keyCode: 38,
- shift: false,
- ctrl: true,
- handler: () => {
- this.volumeSliderValue += 1000;
- this.changeVolume();
- }
- }
- );
- keyboardShortcuts.registerShortcut(
- "station.increaseVolumeSmall",
- {
- keyCode: 38,
- shift: true,
- ctrl: true,
- handler: () => {
- this.volumeSliderValue += 100;
- this.changeVolume();
- }
- }
- );
- // UNIX client time before ping
- const beforePing = Date.now();
- this.socket.emit("apis.ping", pong => {
- // UNIX client time after ping
- const afterPing = Date.now();
- // Average time in MS it took between the server responding and the client receiving
- const connectionLatency = (afterPing - beforePing) / 2;
- console.log(connectionLatency, beforePing - afterPing);
- // UNIX server time
- const serverDate = pong.date;
- // Difference between the server UNIX time and the client UNIX time after ping, with the connectionLatency added to the server UNIX time
- const difference =
- serverDate + connectionLatency - afterPing;
- console.log("Difference: ", difference);
- if (difference > 3000 || difference < -3000) {
- console.log(
- "System time difference is bigger than 3 seconds."
- );
- }
- this.systemDifference = difference;
- });
- } else {
- this.loading = false;
- this.exists = false;
- }
- });
- },
- ...mapActions("sidebars", ["toggleSidebar"]),
- ...mapActions("modals", ["openModal"]),
- ...mapActions("station", [
- "joinStation",
- "updateUserCount",
- "updateUsers",
- "updateCurrentSong",
- "updatePreviousSong",
- "updateSongsList",
- "updateStationPaused",
- "updateLocalPaused",
- "updateNoSong"
- ])
- },
- mounted() {
- Date.currently = () => {
- return new Date().getTime() + this.systemDifference;
- };
- this.stationName = this.$route.params.id;
- window.stationInterval = 0;
- io.getSocket(socket => {
- this.socket = socket;
- io.removeAllListeners();
- if (this.socket.connected) this.join();
- io.onConnect(this.join);
- this.socket.emit("stations.existsByName", this.stationName, res => {
- if (res.status === "failure" || !res.exists) {
- this.loading = false;
- this.exists = false;
- }
- });
- this.socket.on("event:songs.next", data => {
- const previousSong = this.currentSong.songId
- ? this.currentSong
- : null;
- this.updatePreviousSong(previousSong);
- this.updateCurrentSong(
- data.currentSong ? data.currentSong : {}
- );
- this.startedAt = data.startedAt;
- this.updateStationPaused(data.paused);
- this.timePaused = data.timePaused;
- if (data.currentSong) {
- this.updateNoSong(false);
- if (this.currentSong.artists)
- this.currentSong.artists = this.currentSong.artists.join(
- ", "
- );
- if (!this.playerReady) this.youtubeReady();
- else this.playVideo();
- this.socket.emit(
- "songs.getOwnSongRatings",
- data.currentSong.songId,
- song => {
- if (this.currentSong.songId === song.songId) {
- this.liked = song.liked;
- this.disliked = song.disliked;
- }
- }
- );
- } else {
- if (this.playerReady) this.player.pauseVideo();
- this.updateNoSong(true);
- }
- let isInQueue = false;
- this.songsList.forEach(queueSong => {
- if (queueSong.requestedBy === this.userId) isInQueue = true;
- });
- if (
- !isInQueue &&
- this.privatePlaylistQueueSelected &&
- (this.automaticallyRequestedSongId !==
- this.currentSong.songId ||
- !this.currentSong.songId)
- ) {
- this.addFirstPrivatePlaylistSongToQueue();
- }
- });
- this.socket.on("event:stations.pause", data => {
- this.pausedAt = data.pausedAt;
- this.updateStationPaused(true);
- this.pauseLocalPlayer();
- });
- this.socket.on("event:stations.resume", data => {
- this.timePaused = data.timePaused;
- this.updateStationPaused(false);
- if (!this.localPaused) this.resumeLocalPlayer();
- });
- this.socket.on("event:stations.remove", () => {
- window.location.href = "/";
- return true;
- });
- this.socket.on("event:song.like", data => {
- if (!this.noSong) {
- if (data.songId === this.currentSong.songId) {
- this.currentSong.dislikes = data.dislikes;
- this.currentSong.likes = data.likes;
- }
- }
- });
- this.socket.on("event:song.dislike", data => {
- if (!this.noSong) {
- if (data.songId === this.currentSong.songId) {
- this.currentSong.dislikes = data.dislikes;
- this.currentSong.likes = data.likes;
- }
- }
- });
- this.socket.on("event:song.unlike", data => {
- if (!this.noSong) {
- if (data.songId === this.currentSong.songId) {
- this.currentSong.dislikes = data.dislikes;
- this.currentSong.likes = data.likes;
- }
- }
- });
- this.socket.on("event:song.undislike", data => {
- if (!this.noSong) {
- if (data.songId === this.currentSong.songId) {
- this.currentSong.dislikes = data.dislikes;
- this.currentSong.likes = data.likes;
- }
- }
- });
- this.socket.on("event:song.newRatings", data => {
- if (!this.noSong) {
- if (data.songId === this.currentSong.songId) {
- this.liked = data.liked;
- this.disliked = data.disliked;
- }
- }
- });
- this.socket.on("event:queue.update", queue => {
- if (this.station.type === "community")
- this.updateSongsList(queue);
- });
- this.socket.on("event:song.voteSkipSong", () => {
- if (this.currentSong) this.currentSong.skipVotes += 1;
- });
- this.socket.on("event:privatePlaylist.selected", playlistId => {
- if (this.station.type === "community") {
- this.station.privatePlaylist = playlistId;
- }
- });
- this.socket.on("event:partyMode.updated", partyMode => {
- if (this.station.type === "community") {
- this.station.partyMode = partyMode;
- }
- });
- this.socket.on("event:newOfficialPlaylist", playlist => {
- if (this.station.type === "official") {
- this.updateSongsList(playlist);
- }
- });
- this.socket.on("event:users.updated", users => {
- this.updateUsers(users);
- });
- this.socket.on("event:userCount.updated", userCount => {
- this.updateUserCount(userCount);
- });
- this.socket.on("event:queueLockToggled", locked => {
- this.station.locked = locked;
- });
- });
- if (JSON.parse(localStorage.getItem("muted"))) {
- this.muted = true;
- this.player.setVolume(0);
- this.volumeSliderValue = 0 * 100;
- } else {
- let volume = parseFloat(localStorage.getItem("volume"));
- volume =
- typeof volume === "number" && !Number.isNaN(volume)
- ? volume
- : 20;
- localStorage.setItem("volume", volume);
- this.volumeSliderValue = volume * 100;
- }
- },
- beforeDestroy() {
- const shortcutNames = [
- "station.pauseResume",
- "station.skipStation",
- "station.lowerVolumeLarge",
- "station.lowerVolumeSmall",
- "station.increaseVolumeLarge",
- "station.increaseVolumeSmall"
- ];
- shortcutNames.forEach(shortcutName => {
- keyboardShortcuts.unregisterShortcut(shortcutName);
- });
- },
- components: {
- StationHeader,
- SongQueue: () => import("./AddSongToQueue.vue"),
- AddToPlaylist: () => import("./AddSongToPlaylist.vue"),
- EditPlaylist: () => import("../../components/modals/EditPlaylist.vue"),
- CreatePlaylist: () =>
- import("../../components/modals/CreatePlaylist.vue"),
- EditStation: () => import("../../components/modals/EditStation.vue"),
- Report: () => import("./Report.vue"),
- SongsListSidebar: () => import("./SongsList.vue"),
- UsersSidebar: () => import("./UsersList.vue"),
- UserIdToUsername,
- Z404,
- FloatingBox
- }
- };
- </script>
- <style lang="scss">
- @import "../../styles/global.scss";
- .station-parent {
- display: flex;
- flex: 1;
- overflow-x: hidden;
- }
- .night-mode {
- .nav,
- .control-sidebar {
- background-color: #222;
- }
- }
- .player-can-not-autoplay {
- position: absolute;
- width: 100%;
- height: 100%;
- background: rgba(3, 169, 244, 0.95);
- display: flex;
- align-items: center;
- justify-content: center;
- p {
- color: $white;
- font-size: 26px;
- text-align: center;
- }
- }
- // Starting state for enter. Added before element is inserted, removed one frame after element is inserted.
- .slide-outer-enter {
- margin-right: -300px;
- }
- // Active state for enter. Applied during the entire entering phase. Added before element is inserted, removed when transition/animation finishes. This class can be used to define the duration, delay and easing curve for the entering transition.
- .slide-outer-enter-active {
- transition: all 0.3s linear;
- }
- // Only available in versions 2.1.8+. Ending state for enter. Added one frame after element is inserted (at the same time v-enter is removed), removed when transition/animation finishes.
- .slide-outer-enter-to {
- margin-right: 0;
- }
- // Starting state for leave. Added immediately when a leaving transition is triggered, removed after one frame.
- .slide-outer-leave {
- margin-right: 0;
- }
- // Active state for leave. Applied during the entire leaving phase. Added immediately when leave transition is triggered, removed when the transition/animation finishes. This class can be used to define the duration, delay and easing curve for the leaving transition.
- .slide-outer-leave-active {
- transition: all 0.3s linear;
- }
- // Only available in versions 2.1.8+. Ending state for leave. Added one frame after a leaving transition is triggered (at the same time v-leave is removed), removed when the transition/animation finishes.
- .slide-outer-leave-to {
- margin-right: -300px;
- }
- // Starting state for enter. Added before element is inserted, removed one frame after element is inserted.
- .slide-inner-enter {
- transform: translateX(300px);
- }
- // Active state for enter. Applied during the entire entering phase. Added before element is inserted, removed when transition/animation finishes. This class can be used to define the duration, delay and easing curve for the entering transition.
- .slide-inner-enter-active {
- transition: all 0.3s linear;
- z-index: 5;
- }
- // Only available in versions 2.1.8+. Ending state for enter. Added one frame after element is inserted (at the same time v-enter is removed), removed when transition/animation finishes.
- .slide-inner-enter-to {
- transform: translateX(0px);
- }
- // Starting state for leave. Added immediately when a leaving transition is triggered, removed after one frame.
- .slide-inner-leave {
- transform: translateX(0px);
- }
- // Active state for leave. Applied during the entire leaving phase. Added immediately when leave transition is triggered, removed when the transition/animation finishes. This class can be used to define the duration, delay and easing curve for the leaving transition.
- .slide-inner-leave-active {
- transition: all 0.3s linear;
- z-index: 0;
- }
- // Only available in versions 2.1.8+. Ending state for leave. Added one frame after a leaving transition is triggered (at the same time v-leave is removed), removed when the transition/animation finishes.
- .slide-inner-leave-to {
- transform: translateX(300px);
- }
- .sidebar-container {
- width: 300px;
- max-width: 300px;
- // background-color: blue;
- position: relative;
- }
- .sidebar {
- position: absolute;
- // z-index: 1;
- top: 0;
- right: 0;
- width: 300px;
- height: 100%;
- background-color: $white;
- box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16),
- 0 2px 10px 0 rgba(0, 0, 0, 0.12);
- }
- .no-song {
- color: $primary-color;
- text-align: center;
- }
- .volumeSlider {
- padding: 0 15px;
- background: transparent;
- }
- .volume-slider-wrapper {
- margin-top: 0;
- position: relative;
- display: flex;
- align-items: center;
- .material-icons {
- user-select: none;
- }
- }
- .material-icons {
- cursor: pointer;
- }
- .stationDisplayName {
- color: $white !important;
- }
- .add-to-playlist {
- display: flex;
- align-items: center;
- justify-content: center;
- }
- // .slideout {
- // top: 50px;
- // height: 100%;
- // position: fixed;
- // right: 0;
- // width: 350px;
- // background-color: $white;
- // box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16),
- // 0 2px 10px 0 rgba(0, 0, 0, 0.12);
- // .slideout-header {
- // text-align: center;
- // background-color: rgb(3, 169, 244) !important;
- // margin: 0;
- // padding-top: 5px;
- // padding-bottom: 7px;
- // color: $white;
- // }
- // .slideout-content {
- // height: 100%;
- // }
- // }
- .modal-large {
- width: 75%;
- }
- .station {
- padding-top: 0.5vw;
- transition: all 0.1s;
- margin: 0 auto;
- flex: 0.9;
- @media only screen and (min-width: 993px) {
- flex: 0.7;
- }
- @media only screen and (min-width: 601px) {
- flex: 0.85;
- }
- @media (min-width: 999px) {
- .mobile-only {
- display: none;
- }
- .desktop-only {
- display: block;
- }
- }
- @media (max-width: 998px) {
- .mobile-only {
- display: block;
- }
- .desktop-only {
- display: none;
- visibility: hidden;
- }
- }
- .mobile-only {
- text-align: center;
- }
- .playlistCard {
- margin: 10px;
- position: relative;
- padding-bottom: calc(31.25% + 7px);
- height: 0;
- overflow-y: scroll;
- .title {
- background-color: rgb(3, 169, 244);
- text-align: center;
- padding: 10px;
- color: $white;
- font-weight: 600;
- }
- .media {
- padding: 0 25px;
- }
- .media-content .content {
- min-height: 64px;
- max-height: 64px;
- display: flex;
- align-items: center;
- }
- .content p strong {
- word-break: break-word;
- }
- .content p small {
- word-break: break-word;
- }
- .add-to-queue {
- width: 100%;
- margin-top: 25px;
- height: 40px;
- border-radius: 0;
- background: rgb(3, 169, 244);
- color: $white !important;
- border: 0;
- &:active,
- &:focus {
- border: 0;
- }
- }
- .add-to-queue:focus {
- background: $primary-color;
- }
- .media-right {
- line-height: 64px;
- }
- .songTitle {
- word-wrap: break-word;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- line-height: 20px;
- max-height: 40px;
- width: 100%;
- }
- }
- input[type="range"] {
- -webkit-appearance: none;
- width: 100%;
- margin: 7.3px 0;
- }
- input[type="range"]:focus {
- outline: none;
- }
- input[type="range"]::-webkit-slider-runnable-track {
- width: 100%;
- height: 5.2px;
- cursor: pointer;
- box-shadow: 0;
- background: $light-grey-2;
- border-radius: 0;
- border: 0;
- }
- input[type="range"]::-webkit-slider-thumb {
- box-shadow: 0;
- border: 0;
- height: 19px;
- width: 19px;
- border-radius: 15px;
- background: $primary-color;
- cursor: pointer;
- -webkit-appearance: none;
- margin-top: -6.5px;
- }
- input[type="range"]::-moz-range-track {
- width: 100%;
- height: 5.2px;
- cursor: pointer;
- box-shadow: 0;
- background: $light-grey-2;
- border-radius: 0;
- border: 0;
- }
- input[type="range"]::-moz-range-thumb {
- box-shadow: 0;
- border: 0;
- height: 19px;
- width: 19px;
- border-radius: 15px;
- background: $primary-color;
- cursor: pointer;
- -webkit-appearance: none;
- margin-top: -6.5px;
- }
- input[type="range"]::-ms-track {
- width: 100%;
- height: 5.2px;
- cursor: pointer;
- box-shadow: 0;
- background: $light-grey-2;
- border-radius: 1.3px;
- }
- input[type="range"]::-ms-fill-lower {
- background: $light-grey-2;
- border: 0;
- border-radius: 0;
- box-shadow: 0;
- }
- input[type="range"]::-ms-fill-upper {
- background: $light-grey-2;
- border: 0;
- border-radius: 0;
- box-shadow: 0;
- }
- input[type="range"]::-ms-thumb {
- box-shadow: 0;
- border: 0;
- height: 15px;
- width: 15px;
- border-radius: 15px;
- background: $primary-color;
- cursor: pointer;
- -webkit-appearance: none;
- margin-top: 1.5px;
- }
- .video-container {
- position: relative;
- padding-bottom: 56.25%;
- height: 0;
- overflow: hidden;
- iframe {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- }
- }
- .video-col {
- padding-right: 0.75rem;
- padding-left: 0.75rem;
- }
- }
- .room-title {
- left: 50%;
- -webkit-transform: translateX(-50%);
- transform: translateX(-50%);
- font-size: 2.1em;
- }
- #ratings {
- display: flex;
- justify-content: flex-end;
- span {
- font-size: 1.68rem;
- }
- i {
- color: #9e9e9e !important;
- cursor: pointer;
- transition: 0.1s color;
- }
- }
- #time-display {
- margin-top: 30px;
- float: right;
- }
- #thumbs_up:hover,
- #thumbs_up.liked {
- color: $green !important;
- }
- #thumbs_down:hover,
- #thumbs_down.disliked {
- color: $red !important;
- }
- #song-thumbnail {
- max-width: 100%;
- width: 85%;
- }
- .seeker-bar-container {
- position: relative;
- height: 7px;
- display: block;
- width: 100%;
- overflow: hidden;
- }
- .seeker-bar {
- top: 0;
- left: 0;
- bottom: 0;
- position: absolute;
- }
- ul {
- list-style: none;
- margin: 0;
- display: block;
- }
- h1,
- h2,
- h3,
- h4,
- h5,
- h6 {
- font-weight: 400;
- line-height: 1.1;
- }
- h1 a,
- h2 a,
- h3 a,
- h4 a,
- h5 a,
- h6 a {
- font-weight: inherit;
- }
- h1 {
- font-size: 4.2rem;
- line-height: 110%;
- margin: 2.1rem 0 1.68rem 0;
- }
- h2 {
- font-size: 3.56rem;
- line-height: 110%;
- margin: 1.78rem 0 1.424rem 0;
- }
- h3 {
- font-size: 2.92rem;
- line-height: 110%;
- margin: 1.46rem 0 1.168rem 0;
- }
- h4 {
- font-size: 2.28rem;
- line-height: 110%;
- margin: 1.14rem 0 0.912rem 0;
- }
- h5 {
- font-size: 1.64rem;
- line-height: 110%;
- margin: 0.82rem 0 0.656rem 0;
- }
- h6 {
- font-size: 1rem;
- line-height: 110%;
- margin: 0.5rem 0 0.4rem 0;
- }
- .thin {
- font-weight: 200;
- }
- .light-blue {
- background-color: $primary-color !important;
- }
- .white {
- background-color: $white !important;
- }
- .btn-search {
- font-size: 14px;
- }
- .menu {
- padding: 0 10px;
- }
- .menu-list li a:hover {
- color: #000 !important;
- }
- .menu-list li {
- display: flex;
- justify-content: space-between;
- }
- .menu-list a {
- /*padding: 0 10px !important;*/
- }
- .menu-list a:hover {
- background-color: transparent;
- }
- .icons-group {
- display: flex;
- }
- #like,
- #dislike {
- position: relative;
- }
- .behind {
- z-index: -1;
- }
- .behind:focus {
- z-index: 0;
- }
- .progress {
- width: 50px;
- animation: rotate 0.8s infinite linear;
- border: 8px solid $primary-color;
- border-right-color: transparent;
- height: 50px;
- position: absolute;
- top: 50%;
- left: 50%;
- }
- @keyframes rotate {
- 0% {
- transform: rotate(0deg);
- }
- 100% {
- transform: rotate(360deg);
- }
- }
- .experimental {
- display: none !important;
- }
- #playerDebugBox {
- .box-body {
- flex-direction: column;
- b {
- color: #000;
- }
- }
- }
- </style>
|