Station.vue 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762
  1. <template>
  2. <div>
  3. <official-header v-if="type == 'official'" />
  4. <community-header v-if="type == 'community'" />
  5. <song-queue v-if="modals.addSongToQueue" />
  6. <add-to-playlist v-if="modals.addSongToPlaylist" />
  7. <edit-playlist v-if="modals.editPlaylist" />
  8. <create-playlist v-if="modals.createPlaylist" />
  9. <edit-station v-show="modals.editStation" />
  10. <report v-if="modals.report" />
  11. <transition name="slide">
  12. <songs-list-sidebar v-if="sidebars.songslist" />
  13. </transition>
  14. <transition name="slide">
  15. <playlist-sidebar v-if="sidebars.playlist" />
  16. </transition>
  17. <transition name="slide">
  18. <users-sidebar v-if="sidebars.users" />
  19. </transition>
  20. <div v-show="loading" class="progress" />
  21. <div v-show="!loading && exists" class="station">
  22. <div v-show="noSong" class="no-song">
  23. <h1>No song is currently playing</h1>
  24. <h4
  25. v-if="
  26. type === 'community' &&
  27. station.partyMode &&
  28. (!station.locked ||
  29. (station.locked &&
  30. $parent.loggedIn &&
  31. $parent.userId === station.owner))
  32. "
  33. >
  34. <a
  35. href="#"
  36. class="no-song"
  37. @click="
  38. openModal({
  39. sector: 'station',
  40. modal: 'addSongToQueue'
  41. })
  42. "
  43. >Add a song to the queue</a
  44. >
  45. </h4>
  46. <h4
  47. v-if="
  48. type === 'community' &&
  49. !station.partyMode &&
  50. $parent.userId === station.owner &&
  51. !station.privatePlaylist
  52. "
  53. >
  54. <a
  55. href="#"
  56. class="no-song"
  57. @click="sidebars.playlist = true"
  58. >Play a private playlist</a
  59. >
  60. </h4>
  61. <h1
  62. v-if="
  63. type === 'community' &&
  64. !station.partyMode &&
  65. $parent.userId === station.owner &&
  66. station.privatePlaylist
  67. "
  68. >
  69. Maybe you can add some songs to your selected private
  70. playlist and then press the skip button
  71. </h1>
  72. </div>
  73. <div v-show="!noSong" class="columns">
  74. <div
  75. class="column is-8-desktop is-offset-2-desktop is-12-mobile"
  76. >
  77. <div class="video-container">
  78. <div id="player" />
  79. <div
  80. class="player-can-not-autoplay"
  81. v-if="!canAutoplay"
  82. >
  83. <p>
  84. Please click anywhere on the screen for the
  85. video to start
  86. </p>
  87. </div>
  88. </div>
  89. <div
  90. id="preview-progress"
  91. class="seeker-bar-container white"
  92. >
  93. <div class="seeker-bar light-blue" style="width: 0%;" />
  94. </div>
  95. </div>
  96. <div
  97. class="desktop-only column is-3-desktop card playlistCard experimental"
  98. >
  99. <div v-if="type === 'community'" class="title">
  100. Queue
  101. </div>
  102. <div v-else class="title">
  103. Playlist
  104. </div>
  105. <article v-if="!noSong" class="media">
  106. <figure class="media-left">
  107. <p class="image is-64x64">
  108. <img
  109. :src="currentSong.thumbnail"
  110. onerror="this.src='/assets/notes-transparent.png'"
  111. />
  112. </p>
  113. </figure>
  114. <div class="media-content">
  115. <div class="content">
  116. <p>
  117. Current Song:
  118. <br />
  119. <strong>{{ currentSong.title }}</strong>
  120. <br />
  121. <small>{{ currentSong.artists }}</small>
  122. </p>
  123. </div>
  124. </div>
  125. <div class="media-right">
  126. {{ formatTime(currentSong.duration) }}
  127. </div>
  128. </article>
  129. <p v-if="noSong" class="center">
  130. There is currently no song playing.
  131. </p>
  132. <article
  133. v-for="(song, index) in songsList"
  134. :key="index"
  135. class="media"
  136. >
  137. <div class="media-content">
  138. <div class="content">
  139. <strong class="songTitle">{{
  140. song.title
  141. }}</strong>
  142. <br />
  143. <small>{{ song.artists.join(", ") }}</small>
  144. <br />
  145. <div v-if="station.partyMode">
  146. <br />
  147. <small>
  148. Requested by
  149. <b>
  150. <user-id-to-username
  151. :userId="song.requestedBy"
  152. :link="true"
  153. />
  154. </b>
  155. </small>
  156. <button
  157. v-if="isOwnerOnly() || isAdminOnly()"
  158. class="button"
  159. @click="removeFromQueue(song.songId)"
  160. >
  161. REMOVE
  162. </button>
  163. </div>
  164. </div>
  165. </div>
  166. <div class="media-right">
  167. {{ formatTime(song.duration) }}
  168. </div>
  169. </article>
  170. <a
  171. v-if="type === 'community' && $parent.loggedIn"
  172. class="button add-to-queue"
  173. href="#"
  174. @click="
  175. openModal({
  176. sector: 'station',
  177. modal: 'addSongToQueue'
  178. })
  179. "
  180. >Add Song to Queue</a
  181. >
  182. </div>
  183. </div>
  184. <div v-show="!noSong" class="desktop-only columns is-mobile">
  185. <div
  186. class="column is-8-desktop is-offset-2-desktop is-12-mobile"
  187. >
  188. <div class="columns is-mobile">
  189. <div class="column is-12-desktop">
  190. <h4 id="time-display">
  191. {{ timeElapsed }} /
  192. {{ formatTime(currentSong.duration) }}
  193. </h4>
  194. <h3>{{ currentSong.title }}</h3>
  195. <h4 class="thin" style="margin-left: 0">
  196. {{ currentSong.artists }}
  197. </h4>
  198. <div class="columns is-mobile">
  199. <form
  200. style="margin-top: 12px; margin-bottom: 0;"
  201. action="#"
  202. class="column is-7-desktop is-4-mobile"
  203. >
  204. <p class="volume-slider-wrapper">
  205. <i
  206. v-if="muted"
  207. class="material-icons"
  208. @click="toggleMute()"
  209. >volume_mute</i
  210. >
  211. <i
  212. v-else
  213. class="material-icons"
  214. @click="toggleMute()"
  215. >volume_down</i
  216. >
  217. <input
  218. id="volumeSlider"
  219. type="range"
  220. min="0"
  221. max="10000"
  222. class="active"
  223. @change="changeVolume()"
  224. @input="changeVolume()"
  225. />
  226. <i
  227. class="material-icons"
  228. @click="increaseVolume()"
  229. >volume_up</i
  230. >
  231. </p>
  232. </form>
  233. <div
  234. class="column is-8-mobile is-5-desktop"
  235. style="float: right;"
  236. >
  237. <ul
  238. v-if="
  239. currentSong.likes !== -1 &&
  240. currentSong.dislikes !== -1
  241. "
  242. id="ratings"
  243. >
  244. <li
  245. id="like"
  246. class="right"
  247. @click="toggleLike()"
  248. >
  249. <span class="flow-text">{{
  250. currentSong.likes
  251. }}</span>
  252. <i
  253. id="thumbs_up"
  254. class="material-icons grey-text"
  255. :class="{ liked: liked }"
  256. >thumb_up</i
  257. >
  258. <a
  259. class="absolute-a behind"
  260. href="#"
  261. @click="toggleLike()"
  262. />
  263. </li>
  264. <li
  265. id="dislike"
  266. style="margin-right: 10px;"
  267. class="right"
  268. @click="toggleDislike()"
  269. >
  270. <span class="flow-text">{{
  271. currentSong.dislikes
  272. }}</span>
  273. <i
  274. id="thumbs_down"
  275. class="material-icons grey-text"
  276. :class="{
  277. disliked: disliked
  278. }"
  279. >thumb_down</i
  280. >
  281. <a
  282. class="absolute-a behind"
  283. href="#"
  284. @click="toggleDislike()"
  285. />
  286. </li>
  287. </ul>
  288. </div>
  289. </div>
  290. </div>
  291. <div
  292. v-if="!simpleSong"
  293. class="column is-3-desktop experimental"
  294. >
  295. <img
  296. class="image"
  297. :src="currentSong.thumbnail"
  298. alt="Song Thumbnail"
  299. onerror="this.src='/assets/notes-transparent.png'"
  300. />
  301. </div>
  302. </div>
  303. </div>
  304. </div>
  305. <div v-show="!noSong" class="mobile-only">
  306. <div>
  307. <div>
  308. <div>
  309. <h3>{{ currentSong.title }}</h3>
  310. <h4 class="thin">
  311. {{ currentSong.artists }}
  312. </h4>
  313. <h5>
  314. {{ timeElapsed }} /
  315. {{ formatTime(currentSong.duration) }}
  316. </h5>
  317. <div>
  318. <form class="columns" action="#">
  319. <p
  320. class="column is-11-mobile volume-slider-wrapper"
  321. >
  322. <i
  323. v-if="muted"
  324. class="material-icons"
  325. @click="toggleMute()"
  326. >volume_mute</i
  327. >
  328. <i
  329. v-else
  330. class="material-icons"
  331. @click="toggleMute()"
  332. >volume_down</i
  333. >
  334. <input
  335. id="volumeSlider"
  336. type="range"
  337. min="0"
  338. max="10000"
  339. class="active"
  340. @change="changeVolume()"
  341. @input="changeVolume()"
  342. />
  343. <i
  344. class="material-icons"
  345. @click="increaseVolume()"
  346. >volume_up</i
  347. >
  348. </p>
  349. </form>
  350. <div>
  351. <ul
  352. v-if="
  353. currentSong.likes !== -1 &&
  354. currentSong.dislikes !== -1
  355. "
  356. id="ratings"
  357. style="display: inline-block;"
  358. >
  359. <li
  360. id="dislike"
  361. style="display: inline-block;margin-right: 10px;"
  362. @click="toggleDislike()"
  363. >
  364. <span class="flow-text">{{
  365. currentSong.dislikes
  366. }}</span>
  367. <i
  368. id="thumbs_down"
  369. class="material-icons grey-text"
  370. :class="{
  371. disliked: disliked
  372. }"
  373. >thumb_down</i
  374. >
  375. <a
  376. class="absolute-a behind"
  377. href="#"
  378. @click="toggleDislike()"
  379. />
  380. </li>
  381. <li
  382. id="like"
  383. style="display: inline-block;"
  384. @click="toggleLike()"
  385. >
  386. <span class="flow-text">{{
  387. currentSong.likes
  388. }}</span>
  389. <i
  390. id="thumbs_up"
  391. class="material-icons grey-text"
  392. :class="{ liked: liked }"
  393. >thumb_up</i
  394. >
  395. <a
  396. class="absolute-a behind"
  397. href="#"
  398. @click="toggleLike()"
  399. />
  400. </li>
  401. </ul>
  402. </div>
  403. </div>
  404. </div>
  405. </div>
  406. </div>
  407. </div>
  408. </div>
  409. <Z404 v-if="!exists"></Z404>
  410. </div>
  411. </template>
  412. <script>
  413. import { mapState, mapActions } from "vuex";
  414. import { Toast } from "vue-roaster";
  415. import SongQueue from "../Modals/AddSongToQueue.vue";
  416. import AddToPlaylist from "../Modals/AddSongToPlaylist.vue";
  417. import EditPlaylist from "../Modals/Playlists/Edit.vue";
  418. import CreatePlaylist from "../Modals/Playlists/Create.vue";
  419. import EditStation from "../Modals/EditStation.vue";
  420. import Report from "../Modals/Report.vue";
  421. import SongsListSidebar from "../Sidebars/SongsList.vue";
  422. import PlaylistSidebar from "../Sidebars/Playlist.vue";
  423. import UsersSidebar from "../Sidebars/UsersList.vue";
  424. import OfficialHeader from "./OfficialHeader.vue";
  425. import CommunityHeader from "./CommunityHeader.vue";
  426. import UserIdToUsername from "../UserIdToUsername.vue";
  427. import Z404 from "../404.vue";
  428. import io from "../../io";
  429. export default {
  430. data() {
  431. return {
  432. loading: true,
  433. ready: false,
  434. exists: true,
  435. type: "",
  436. playerReady: false,
  437. previousSong: null,
  438. currentSong: {},
  439. player: undefined,
  440. timePaused: 0,
  441. paused: false,
  442. muted: false,
  443. timeElapsed: "0:00",
  444. liked: false,
  445. disliked: false,
  446. sidebars: {
  447. songslist: false,
  448. users: false,
  449. playlist: false
  450. },
  451. noSong: false,
  452. simpleSong: false,
  453. songsList: [],
  454. timeBeforePause: 0,
  455. skipVotes: 0,
  456. privatePlaylistQueueSelected: null,
  457. automaticallyRequestedSongId: null,
  458. systemDifference: 0,
  459. users: [],
  460. userCount: 0,
  461. attemptsToPlayVideo: 0,
  462. canAutoplay: true,
  463. lastTimeRequestedIfCanAutoplay: 0
  464. };
  465. },
  466. computed: {
  467. ...mapState("modals", {
  468. modals: state => state.modals.station
  469. }),
  470. ...mapState("station", {
  471. station: state => state.station
  472. })
  473. },
  474. methods: {
  475. isOwnerOnly() {
  476. return (
  477. this.$parent.loggedIn &&
  478. this.$parent.userId === this.station.owner
  479. );
  480. },
  481. isAdminOnly() {
  482. return this.$parent.loggedIn && this.$parent.role === "admin";
  483. },
  484. removeFromQueue(songId) {
  485. window.socket.emit(
  486. "stations.removeFromQueue",
  487. this.station._id,
  488. songId,
  489. res => {
  490. if (res.status === "success") {
  491. Toast.methods.addToast(
  492. "Successfully removed song from the queue.",
  493. 4000
  494. );
  495. } else Toast.methods.addToast(res.message, 8000);
  496. }
  497. );
  498. },
  499. toggleSidebar(type) {
  500. Object.keys(this.sidebars).forEach(sidebar => {
  501. if (sidebar !== type) this.sidebars[sidebar] = false;
  502. else this.sidebars[type] = !this.sidebars[type];
  503. });
  504. },
  505. youtubeReady() {
  506. const local = this;
  507. if (!local.player) {
  508. local.player = new window.YT.Player("player", {
  509. height: 270,
  510. width: 480,
  511. videoId: local.currentSong.songId,
  512. startSeconds:
  513. local.getTimeElapsed() / 1000 +
  514. local.currentSong.skipDuration,
  515. playerVars: {
  516. controls: 0,
  517. iv_load_policy: 3,
  518. rel: 0,
  519. showinfo: 0
  520. },
  521. events: {
  522. onReady() {
  523. local.playerReady = true;
  524. let volume = parseInt(
  525. localStorage.getItem("volume")
  526. );
  527. volume = typeof volume === "number" ? volume : 20;
  528. local.player.setVolume(volume);
  529. if (volume > 0) {
  530. local.player.unMute();
  531. }
  532. if (local.muted) local.player.mute();
  533. local.playVideo();
  534. },
  535. onError(err) {
  536. console.log("iframe error", err);
  537. local.voteSkipStation();
  538. },
  539. onStateChange(event) {
  540. if (
  541. event.data === 1 &&
  542. local.videoLoading === true
  543. ) {
  544. local.videoLoading = false;
  545. local.player.seekTo(
  546. local.getTimeElapsed() / 1000 +
  547. local.currentSong.skipDuration,
  548. true
  549. );
  550. if (local.paused) local.player.pauseVideo();
  551. } else if (event.data === 1 && local.paused) {
  552. local.player.seekTo(
  553. local.timeBeforePause / 1000,
  554. true
  555. );
  556. local.player.pauseVideo();
  557. }
  558. if (
  559. event.data === 2 &&
  560. !local.paused &&
  561. !local.noSong &&
  562. local.player.getDuration() / 1000 <
  563. local.currentSong.duration
  564. ) {
  565. local.player.seekTo(
  566. local.getTimeElapsed() / 1000 +
  567. local.currentSong.skipDuration,
  568. true
  569. );
  570. local.player.playVideo();
  571. }
  572. }
  573. }
  574. });
  575. }
  576. },
  577. getTimeElapsed() {
  578. const local = this;
  579. if (local.currentSong) {
  580. let { timePaused } = local;
  581. if (local.paused)
  582. timePaused += Date.currently() - local.pausedAt;
  583. return Date.currently() - local.startedAt - timePaused;
  584. }
  585. return 0;
  586. },
  587. playVideo() {
  588. const local = this;
  589. if (local.playerReady) {
  590. local.videoLoading = true;
  591. local.player.loadVideoById(
  592. local.currentSong.songId,
  593. local.getTimeElapsed() / 1000 +
  594. local.currentSong.skipDuration
  595. );
  596. if (window.stationInterval !== 0)
  597. clearInterval(window.stationInterval);
  598. window.stationInterval = setInterval(() => {
  599. local.resizeSeekerbar();
  600. local.calculateTimeElapsed();
  601. }, 150);
  602. }
  603. },
  604. resizeSeekerbar() {
  605. const local = this;
  606. if (!local.paused) {
  607. document.getElementsByClassName(
  608. "seeker-bar"
  609. )[0].style.width = `${parseFloat(
  610. (local.getTimeElapsed() /
  611. 1000 /
  612. local.currentSong.duration) *
  613. 100
  614. )}%`;
  615. }
  616. },
  617. formatTime(duration) {
  618. const dur = moment.duration(duration, "seconds");
  619. if (duration < 0) return "0:00";
  620. const getHours = () => {
  621. if (dur.hours > 0) {
  622. if (dur.hours() < 10) return `0${dur.hours()}:`;
  623. return `${dur.hours()}:`;
  624. }
  625. return "";
  626. };
  627. return `${getHours()}${dur.minutes()}:${
  628. dur.seconds() < 10 ? `0${dur.seconds()}` : dur.seconds()
  629. }`;
  630. },
  631. calculateTimeElapsed() {
  632. const local = this;
  633. if (
  634. local.playerReady &&
  635. local.currentSong &&
  636. local.player.getPlayerState() === -1
  637. ) {
  638. if (local.attemptsToPlayVideo >= 5) {
  639. if (
  640. Date.now() - local.lastTimeRequestedIfCanAutoplay >
  641. 2000
  642. ) {
  643. local.lastTimeRequestedIfCanAutoplay = Date.now();
  644. window.canAutoplay.video().then(({ result }) => {
  645. if (result) {
  646. local.attemptsToPlayVideo = 0;
  647. local.canAutoplay = true;
  648. } else {
  649. local.canAutoplay = false;
  650. }
  651. });
  652. }
  653. } else {
  654. local.player.playVideo();
  655. local.attemptsToPlayVideo += 1;
  656. }
  657. }
  658. if (!local.paused) {
  659. const timeElapsed = local.getTimeElapsed();
  660. const currentPlayerTime = local.player.getCurrentTime() * 1000;
  661. const difference = timeElapsed - currentPlayerTime;
  662. // console.log(difference123);
  663. if (difference < -200) {
  664. // console.log("Difference0.8");
  665. local.player.setPlaybackRate(0.8);
  666. } else if (difference < -50) {
  667. // console.log("Difference0.9");
  668. local.player.setPlaybackRate(0.9);
  669. } else if (difference < -25) {
  670. // console.log("Difference0.99");
  671. local.player.setPlaybackRate(0.99);
  672. } else if (difference > 200) {
  673. // console.log("Difference1.2");
  674. local.player.setPlaybackRate(1.2);
  675. } else if (difference > 50) {
  676. // console.log("Difference1.1");
  677. local.player.setPlaybackRate(1.1);
  678. } else if (difference > 25) {
  679. // console.log("Difference1.01");
  680. local.player.setPlaybackRate(1.01);
  681. } else if (local.player.getPlaybackRate !== 1.0) {
  682. // console.log("NDifference1.0");
  683. local.player.setPlaybackRate(1.0);
  684. }
  685. }
  686. /* if (local.currentTime !== undefined && local.paused) {
  687. local.timePaused += Date.currently() - local.currentTime;
  688. local.currentTime = undefined;
  689. } */
  690. let { timePaused } = local;
  691. if (local.paused) timePaused += Date.currently() - local.pausedAt;
  692. const duration =
  693. (Date.currently() - local.startedAt - timePaused) / 1000;
  694. const songDuration = local.currentSong.duration;
  695. if (songDuration <= duration) local.player.pauseVideo();
  696. if (!local.paused && duration <= songDuration)
  697. local.timeElapsed = local.formatTime(duration);
  698. },
  699. toggleLock() {
  700. window.socket.emit("stations.toggleLock", this.station._id, res => {
  701. if (res.status === "success") {
  702. Toast.methods.addToast(
  703. "Successfully toggled the queue lock.",
  704. 4000
  705. );
  706. } else Toast.methods.addToast(res.message, 8000);
  707. });
  708. },
  709. changeVolume() {
  710. const local = this;
  711. const volume = document.getElementById("volumeSlider").value;
  712. localStorage.setItem("volume", volume / 100);
  713. if (local.playerReady) {
  714. local.player.setVolume(volume / 100);
  715. if (volume > 0) {
  716. local.player.unMute();
  717. localStorage.setItem("muted", false);
  718. local.muted = false;
  719. }
  720. }
  721. },
  722. resumeLocalStation() {
  723. this.paused = false;
  724. if (!this.noSong) {
  725. if (this.playerReady) {
  726. this.player.seekTo(
  727. this.getTimeElapsed() / 1000 +
  728. this.currentSong.skipDuration
  729. );
  730. this.player.playVideo();
  731. }
  732. }
  733. },
  734. pauseLocalStation() {
  735. this.paused = true;
  736. if (!this.noSong) {
  737. this.timeBeforePause = this.getTimeElapsed();
  738. if (this.playerReady) this.player.pauseVideo();
  739. }
  740. },
  741. skipStation() {
  742. const _this = this;
  743. _this.socket.emit("stations.forceSkip", _this.station._id, data => {
  744. if (data.status !== "success")
  745. Toast.methods.addToast(`Error: ${data.message}`, 8000);
  746. else
  747. Toast.methods.addToast(
  748. "Successfully skipped the station's current song.",
  749. 4000
  750. );
  751. });
  752. },
  753. voteSkipStation() {
  754. const _this = this;
  755. _this.socket.emit("stations.voteSkip", _this.station._id, data => {
  756. if (data.status !== "success")
  757. Toast.methods.addToast(`Error: ${data.message}`, 8000);
  758. else
  759. Toast.methods.addToast(
  760. "Successfully voted to skip the current song.",
  761. 4000
  762. );
  763. });
  764. },
  765. resumeStation() {
  766. const _this = this;
  767. _this.socket.emit("stations.resume", _this.station._id, data => {
  768. if (data.status !== "success")
  769. Toast.methods.addToast(`Error: ${data.message}`, 8000);
  770. else
  771. Toast.methods.addToast(
  772. "Successfully resumed the station.",
  773. 4000
  774. );
  775. });
  776. },
  777. pauseStation() {
  778. const _this = this;
  779. _this.socket.emit("stations.pause", _this.station._id, data => {
  780. if (data.status !== "success")
  781. Toast.methods.addToast(`Error: ${data.message}`, 8000);
  782. else
  783. Toast.methods.addToast(
  784. "Successfully paused the station.",
  785. 4000
  786. );
  787. });
  788. },
  789. toggleMute() {
  790. if (this.playerReady) {
  791. const previousVolume = parseFloat(
  792. localStorage.getItem("volume")
  793. );
  794. const volume =
  795. this.player.getVolume() * 100 <= 0 ? previousVolume : 0;
  796. this.muted = !this.muted;
  797. localStorage.setItem("muted", this.muted);
  798. document.getElementById("volumeSlider").value = volume * 100;
  799. this.player.setVolume(volume);
  800. if (!this.muted) localStorage.setItem("volume", volume);
  801. }
  802. },
  803. increaseVolume() {
  804. if (this.playerReady) {
  805. const previousVolume = parseInt(localStorage.getItem("volume"));
  806. let volume = previousVolume + 5;
  807. if (previousVolume === 0) {
  808. this.muted = false;
  809. localStorage.setItem("muted", false);
  810. }
  811. if (volume > 100) volume = 100;
  812. document.getElementById("volumeSlider").value = volume * 100;
  813. this.player.setVolume(volume);
  814. localStorage.setItem("volume", volume);
  815. }
  816. },
  817. toggleLike() {
  818. const _this = this;
  819. if (_this.liked)
  820. _this.socket.emit(
  821. "songs.unlike",
  822. _this.currentSong.songId,
  823. data => {
  824. if (data.status !== "success")
  825. Toast.methods.addToast(
  826. `Error: ${data.message}`,
  827. 8000
  828. );
  829. }
  830. );
  831. else
  832. _this.socket.emit(
  833. "songs.like",
  834. _this.currentSong.songId,
  835. data => {
  836. if (data.status !== "success")
  837. Toast.methods.addToast(
  838. `Error: ${data.message}`,
  839. 8000
  840. );
  841. }
  842. );
  843. },
  844. toggleDislike() {
  845. const _this = this;
  846. if (_this.disliked)
  847. return _this.socket.emit(
  848. "songs.undislike",
  849. _this.currentSong.songId,
  850. data => {
  851. if (data.status !== "success")
  852. Toast.methods.addToast(
  853. `Error: ${data.message}`,
  854. 8000
  855. );
  856. }
  857. );
  858. return _this.socket.emit(
  859. "songs.dislike",
  860. _this.currentSong.songId,
  861. data => {
  862. if (data.status !== "success")
  863. Toast.methods.addToast(`Error: ${data.message}`, 8000);
  864. }
  865. );
  866. },
  867. addFirstPrivatePlaylistSongToQueue() {
  868. const _this = this;
  869. let isInQueue = false;
  870. const { userId } = _this.$parent;
  871. if (_this.type === "community") {
  872. _this.songsList.forEach(queueSong => {
  873. if (queueSong.requestedBy === userId) isInQueue = true;
  874. });
  875. if (!isInQueue && _this.privatePlaylistQueueSelected) {
  876. _this.socket.emit(
  877. "playlists.getFirstSong",
  878. _this.privatePlaylistQueueSelected,
  879. data => {
  880. if (data.status === "success") {
  881. if (data.song.duration < 15 * 60) {
  882. _this.automaticallyRequestedSongId =
  883. data.song.songId;
  884. _this.socket.emit(
  885. "stations.addToQueue",
  886. _this.station._id,
  887. data.song.songId,
  888. data2 => {
  889. if (data2.status === "success") {
  890. _this.socket.emit(
  891. "playlists.moveSongToBottom",
  892. _this.privatePlaylistQueueSelected,
  893. data.song.songId,
  894. data3 => {
  895. if (
  896. data3.status ===
  897. "success"
  898. ) {} // eslint-disable-line
  899. }
  900. );
  901. }
  902. }
  903. );
  904. } else {
  905. Toast.methods.addToast(
  906. `Top song in playlist was too long to be added.`,
  907. 3000
  908. );
  909. _this.socket.emit(
  910. "playlists.moveSongToBottom",
  911. _this.privatePlaylistQueueSelected,
  912. data.song.songId,
  913. data3 => {
  914. if (data3.status === "success") {
  915. setTimeout(() => {
  916. this.addFirstPrivatePlaylistSongToQueue();
  917. }, 3000);
  918. }
  919. }
  920. );
  921. }
  922. }
  923. }
  924. );
  925. }
  926. }
  927. },
  928. join() {
  929. const _this = this;
  930. _this.socket.emit("stations.join", _this.stationName, res => {
  931. if (res.status === "success") {
  932. _this.loading = false;
  933. const {
  934. _id,
  935. displayName,
  936. description,
  937. privacy,
  938. locked,
  939. partyMode,
  940. owner,
  941. privatePlaylist
  942. } = res.data;
  943. document.title = `Musare - ${displayName}`;
  944. _this.joinStation({
  945. _id,
  946. name: _this.stationName,
  947. displayName,
  948. description,
  949. privacy,
  950. locked,
  951. partyMode,
  952. owner,
  953. privatePlaylist
  954. });
  955. _this.currentSong = res.data.currentSong
  956. ? res.data.currentSong
  957. : {};
  958. if (_this.currentSong.artists)
  959. _this.currentSong.artists = _this.currentSong.artists.join(
  960. ", "
  961. );
  962. _this.type = res.data.type;
  963. _this.startedAt = res.data.startedAt;
  964. _this.paused = res.data.paused;
  965. _this.timePaused = res.data.timePaused;
  966. _this.userCount = res.data.userCount;
  967. _this.users = res.data.users;
  968. _this.pausedAt = res.data.pausedAt;
  969. if (res.data.currentSong) {
  970. _this.noSong = false;
  971. _this.simpleSong =
  972. res.data.currentSong.likes === -1 &&
  973. res.data.currentSong.dislikes === -1;
  974. if (_this.simpleSong) {
  975. _this.currentSong.skipDuration = 0;
  976. }
  977. _this.youtubeReady();
  978. _this.playVideo();
  979. _this.socket.emit(
  980. "songs.getOwnSongRatings",
  981. res.data.currentSong.songId,
  982. data => {
  983. if (_this.currentSong.songId === data.songId) {
  984. _this.liked = data.liked;
  985. _this.disliked = data.disliked;
  986. }
  987. }
  988. );
  989. } else {
  990. if (_this.playerReady) _this.player.pauseVideo();
  991. _this.noSong = true;
  992. }
  993. // UNIX client time before ping
  994. const beforePing = Date.now();
  995. _this.socket.emit("apis.ping", pong => {
  996. // UNIX client time after ping
  997. const afterPing = Date.now();
  998. // Average time in MS it took between the server responding and the client receiving
  999. const connectionLatency = (afterPing - beforePing) / 2;
  1000. console.log(connectionLatency, beforePing - afterPing);
  1001. // UNIX server time
  1002. const serverDate = pong.date;
  1003. // Difference between the server UNIX time and the client UNIX time after ping, with the connectionLatency added to the server UNIX time
  1004. const difference =
  1005. serverDate + connectionLatency - afterPing;
  1006. console.log("Difference: ", difference);
  1007. if (difference > 3000 || difference < -3000) {
  1008. console.log(
  1009. "System time difference is bigger than 3 seconds."
  1010. );
  1011. }
  1012. _this.systemDifference = difference;
  1013. });
  1014. }
  1015. });
  1016. },
  1017. ...mapActions("modals", ["openModal"]),
  1018. ...mapActions("station", ["joinStation"])
  1019. },
  1020. mounted() {
  1021. const _this = this;
  1022. Date.currently = () => {
  1023. return new Date().getTime() + _this.systemDifference;
  1024. };
  1025. _this.stationName = _this.$route.params.id;
  1026. window.stationInterval = 0;
  1027. io.getSocket(socket => {
  1028. _this.socket = socket;
  1029. io.removeAllListeners();
  1030. if (_this.socket.connected) _this.join();
  1031. io.onConnect(_this.join);
  1032. _this.socket.emit("stations.findByName", _this.stationName, res => {
  1033. if (res.status === "failure") {
  1034. _this.loading = false;
  1035. _this.exists = false;
  1036. } else {
  1037. _this.exists = true;
  1038. }
  1039. });
  1040. _this.socket.on("event:songs.next", data => {
  1041. _this.previousSong = _this.currentSong.songId
  1042. ? _this.currentSong
  1043. : null;
  1044. _this.currentSong = data.currentSong ? data.currentSong : {};
  1045. _this.startedAt = data.startedAt;
  1046. _this.paused = data.paused;
  1047. _this.timePaused = data.timePaused;
  1048. if (data.currentSong) {
  1049. _this.noSong = false;
  1050. if (_this.currentSong.artists)
  1051. _this.currentSong.artists = _this.currentSong.artists.join(
  1052. ", "
  1053. );
  1054. _this.simpleSong =
  1055. data.currentSong.likes === -1 &&
  1056. data.currentSong.dislikes === -1;
  1057. if (_this.simpleSong) _this.currentSong.skipDuration = 0;
  1058. if (!_this.playerReady) _this.youtubeReady();
  1059. else _this.playVideo();
  1060. _this.socket.emit(
  1061. "songs.getOwnSongRatings",
  1062. data.currentSong.songId,
  1063. song => {
  1064. if (_this.currentSong.songId === song.songId) {
  1065. _this.liked = song.liked;
  1066. _this.disliked = song.disliked;
  1067. }
  1068. }
  1069. );
  1070. } else {
  1071. if (_this.playerReady) _this.player.pauseVideo();
  1072. _this.noSong = true;
  1073. }
  1074. let isInQueue = false;
  1075. const { userId } = _this.$parent;
  1076. _this.songsList.forEach(queueSong => {
  1077. if (queueSong.requestedBy === userId) isInQueue = true;
  1078. });
  1079. if (
  1080. !isInQueue &&
  1081. _this.privatePlaylistQueueSelected &&
  1082. (_this.automaticallyRequestedSongId !==
  1083. _this.currentSong.songId ||
  1084. !_this.currentSong.songId)
  1085. ) {
  1086. _this.addFirstPrivatePlaylistSongToQueue();
  1087. }
  1088. });
  1089. _this.socket.on("event:stations.pause", data => {
  1090. _this.pausedAt = data.pausedAt;
  1091. _this.pauseLocalStation();
  1092. });
  1093. _this.socket.on("event:stations.resume", data => {
  1094. _this.timePaused = data.timePaused;
  1095. _this.resumeLocalStation();
  1096. });
  1097. _this.socket.on("event:stations.remove", () => {
  1098. window.location.href = "/";
  1099. return true;
  1100. });
  1101. _this.socket.on("event:song.like", data => {
  1102. if (!this.noSong) {
  1103. if (data.songId === _this.currentSong.songId) {
  1104. _this.currentSong.dislikes = data.dislikes;
  1105. _this.currentSong.likes = data.likes;
  1106. }
  1107. }
  1108. });
  1109. _this.socket.on("event:song.dislike", data => {
  1110. if (!this.noSong) {
  1111. if (data.songId === _this.currentSong.songId) {
  1112. _this.currentSong.dislikes = data.dislikes;
  1113. _this.currentSong.likes = data.likes;
  1114. }
  1115. }
  1116. });
  1117. _this.socket.on("event:song.unlike", data => {
  1118. if (!this.noSong) {
  1119. if (data.songId === _this.currentSong.songId) {
  1120. _this.currentSong.dislikes = data.dislikes;
  1121. _this.currentSong.likes = data.likes;
  1122. }
  1123. }
  1124. });
  1125. _this.socket.on("event:song.undislike", data => {
  1126. if (!this.noSong) {
  1127. if (data.songId === _this.currentSong.songId) {
  1128. _this.currentSong.dislikes = data.dislikes;
  1129. _this.currentSong.likes = data.likes;
  1130. }
  1131. }
  1132. });
  1133. _this.socket.on("event:song.newRatings", data => {
  1134. if (!this.noSong) {
  1135. if (data.songId === _this.currentSong.songId) {
  1136. _this.liked = data.liked;
  1137. _this.disliked = data.disliked;
  1138. }
  1139. }
  1140. });
  1141. _this.socket.on("event:queue.update", queue => {
  1142. if (this.type === "community") this.songsList = queue;
  1143. });
  1144. _this.socket.on("event:song.voteSkipSong", () => {
  1145. if (this.currentSong) this.currentSong.skipVotes += 1;
  1146. });
  1147. _this.socket.on("event:privatePlaylist.selected", playlistId => {
  1148. if (this.type === "community") {
  1149. this.station.privatePlaylist = playlistId;
  1150. }
  1151. });
  1152. _this.socket.on("event:partyMode.updated", partyMode => {
  1153. if (this.type === "community") {
  1154. this.station.partyMode = partyMode;
  1155. }
  1156. });
  1157. _this.socket.on("event:newOfficialPlaylist", playlist => {
  1158. if (this.type === "official") {
  1159. this.songsList = playlist;
  1160. }
  1161. });
  1162. _this.socket.on("event:users.updated", users => {
  1163. _this.users = users;
  1164. });
  1165. _this.socket.on("event:userCount.updated", userCount => {
  1166. _this.userCount = userCount;
  1167. });
  1168. _this.socket.on("event:queueLockToggled", locked => {
  1169. _this.station.locked = locked;
  1170. });
  1171. });
  1172. if (JSON.parse(localStorage.getItem("muted"))) {
  1173. this.muted = true;
  1174. this.player.setVolume(0);
  1175. document.getElementById("volumeSlider").value = 0 * 100;
  1176. } else {
  1177. let volume = parseFloat(localStorage.getItem("volume"));
  1178. volume =
  1179. typeof volume === "number" && !Number.isNaN(volume)
  1180. ? volume
  1181. : 20;
  1182. localStorage.setItem("volume", volume);
  1183. document.getElementById("volumeSlider").value = volume * 100;
  1184. }
  1185. },
  1186. components: {
  1187. OfficialHeader,
  1188. CommunityHeader,
  1189. SongQueue,
  1190. AddToPlaylist,
  1191. EditPlaylist,
  1192. CreatePlaylist,
  1193. EditStation,
  1194. Report,
  1195. SongsListSidebar,
  1196. PlaylistSidebar,
  1197. UsersSidebar,
  1198. UserIdToUsername,
  1199. Z404
  1200. }
  1201. };
  1202. </script>
  1203. <style lang="scss">
  1204. .player-can-not-autoplay {
  1205. position: absolute;
  1206. width: 100%;
  1207. height: 100%;
  1208. background: rgba(3, 169, 244, 0.95);
  1209. display: flex;
  1210. align-items: center;
  1211. justify-content: center;
  1212. p {
  1213. color: white;
  1214. font-size: 26px;
  1215. text-align: center;
  1216. }
  1217. }
  1218. .slide-enter-active,
  1219. .slide-leave-active {
  1220. transition: all 0.3s ease;
  1221. }
  1222. .slide-enter,
  1223. .slide-leave-to {
  1224. transform: translateX(300px);
  1225. }
  1226. .no-song {
  1227. color: #03a9f4;
  1228. text-align: center;
  1229. }
  1230. #volumeSlider {
  1231. padding: 0 15px;
  1232. background: transparent;
  1233. }
  1234. .volume-slider-wrapper {
  1235. margin-top: 0;
  1236. position: relative;
  1237. display: flex;
  1238. align-items: center;
  1239. .material-icons {
  1240. user-select: none;
  1241. }
  1242. }
  1243. .material-icons {
  1244. cursor: pointer;
  1245. }
  1246. .stationDisplayName {
  1247. color: white !important;
  1248. }
  1249. .add-to-playlist {
  1250. display: flex;
  1251. align-items: center;
  1252. justify-content: center;
  1253. }
  1254. .slideout {
  1255. top: 50px;
  1256. height: 100%;
  1257. position: fixed;
  1258. right: 0;
  1259. width: 350px;
  1260. background-color: white;
  1261. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16),
  1262. 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  1263. .slideout-header {
  1264. text-align: center;
  1265. background-color: rgb(3, 169, 244) !important;
  1266. margin: 0;
  1267. padding-top: 5px;
  1268. padding-bottom: 7px;
  1269. color: white;
  1270. }
  1271. .slideout-content {
  1272. height: 100%;
  1273. }
  1274. }
  1275. .modal-large {
  1276. width: 75%;
  1277. }
  1278. .station {
  1279. flex: 1 0 auto;
  1280. padding-top: 0.5vw;
  1281. transition: all 0.1s;
  1282. margin: 0 auto;
  1283. max-width: 100%;
  1284. width: 90%;
  1285. @media only screen and (min-width: 993px) {
  1286. width: 70%;
  1287. }
  1288. @media only screen and (min-width: 601px) {
  1289. width: 85%;
  1290. }
  1291. @media (min-width: 999px) {
  1292. .mobile-only {
  1293. display: none;
  1294. }
  1295. .desktop-only {
  1296. display: block;
  1297. }
  1298. }
  1299. @media (max-width: 998px) {
  1300. .mobile-only {
  1301. display: block;
  1302. }
  1303. .desktop-only {
  1304. display: none;
  1305. visibility: hidden;
  1306. }
  1307. }
  1308. .mobile-only {
  1309. text-align: center;
  1310. }
  1311. .playlistCard {
  1312. margin: 10px;
  1313. position: relative;
  1314. padding-bottom: calc(31.25% + 7px);
  1315. height: 0;
  1316. overflow-y: scroll;
  1317. .title {
  1318. background-color: rgb(3, 169, 244);
  1319. text-align: center;
  1320. padding: 10px;
  1321. color: white;
  1322. font-weight: 600;
  1323. }
  1324. .media {
  1325. padding: 0 25px;
  1326. }
  1327. .media-content .content {
  1328. min-height: 64px;
  1329. max-height: 64px;
  1330. display: flex;
  1331. align-items: center;
  1332. }
  1333. .content p strong {
  1334. word-break: break-word;
  1335. }
  1336. .content p small {
  1337. word-break: break-word;
  1338. }
  1339. .add-to-queue {
  1340. width: 100%;
  1341. margin-top: 25px;
  1342. height: 40px;
  1343. border-radius: 0;
  1344. background: rgb(3, 169, 244);
  1345. color: #fff !important;
  1346. border: 0;
  1347. &:active,
  1348. &:focus {
  1349. border: 0;
  1350. }
  1351. }
  1352. .add-to-queue:focus {
  1353. background: #029ce3;
  1354. }
  1355. .media-right {
  1356. line-height: 64px;
  1357. }
  1358. .songTitle {
  1359. word-wrap: break-word;
  1360. overflow: hidden;
  1361. text-overflow: ellipsis;
  1362. display: -webkit-box;
  1363. -webkit-box-orient: vertical;
  1364. -webkit-line-clamp: 2;
  1365. line-height: 20px;
  1366. max-height: 40px;
  1367. width: 100%;
  1368. }
  1369. }
  1370. input[type="range"] {
  1371. -webkit-appearance: none;
  1372. width: 100%;
  1373. margin: 7.3px 0;
  1374. }
  1375. input[type="range"]:focus {
  1376. outline: none;
  1377. }
  1378. input[type="range"]::-webkit-slider-runnable-track {
  1379. width: 100%;
  1380. height: 5.2px;
  1381. cursor: pointer;
  1382. box-shadow: 0;
  1383. background: #c2c0c2;
  1384. border-radius: 0;
  1385. border: 0;
  1386. }
  1387. input[type="range"]::-webkit-slider-thumb {
  1388. box-shadow: 0;
  1389. border: 0;
  1390. height: 19px;
  1391. width: 19px;
  1392. border-radius: 15px;
  1393. background: #03a9f4;
  1394. cursor: pointer;
  1395. -webkit-appearance: none;
  1396. margin-top: -6.5px;
  1397. }
  1398. input[type="range"]::-moz-range-track {
  1399. width: 100%;
  1400. height: 5.2px;
  1401. cursor: pointer;
  1402. box-shadow: 0;
  1403. background: #c2c0c2;
  1404. border-radius: 0;
  1405. border: 0;
  1406. }
  1407. input[type="range"]::-moz-range-thumb {
  1408. box-shadow: 0;
  1409. border: 0;
  1410. height: 19px;
  1411. width: 19px;
  1412. border-radius: 15px;
  1413. background: #03a9f4;
  1414. cursor: pointer;
  1415. -webkit-appearance: none;
  1416. margin-top: -6.5px;
  1417. }
  1418. input[type="range"]::-ms-track {
  1419. width: 100%;
  1420. height: 5.2px;
  1421. cursor: pointer;
  1422. box-shadow: 0;
  1423. background: #c2c0c2;
  1424. border-radius: 1.3px;
  1425. }
  1426. input[type="range"]::-ms-fill-lower {
  1427. background: #c2c0c2;
  1428. border: 0;
  1429. border-radius: 0;
  1430. box-shadow: 0;
  1431. }
  1432. input[type="range"]::-ms-fill-upper {
  1433. background: #c2c0c2;
  1434. border: 0;
  1435. border-radius: 0;
  1436. box-shadow: 0;
  1437. }
  1438. input[type="range"]::-ms-thumb {
  1439. box-shadow: 0;
  1440. border: 0;
  1441. height: 15px;
  1442. width: 15px;
  1443. border-radius: 15px;
  1444. background: #03a9f4;
  1445. cursor: pointer;
  1446. -webkit-appearance: none;
  1447. margin-top: 1.5px;
  1448. }
  1449. .video-container {
  1450. position: relative;
  1451. padding-bottom: 56.25%;
  1452. height: 0;
  1453. overflow: hidden;
  1454. iframe {
  1455. position: absolute;
  1456. top: 0;
  1457. left: 0;
  1458. width: 100%;
  1459. height: 100%;
  1460. }
  1461. }
  1462. .video-col {
  1463. padding-right: 0.75rem;
  1464. padding-left: 0.75rem;
  1465. }
  1466. }
  1467. .room-title {
  1468. left: 50%;
  1469. -webkit-transform: translateX(-50%);
  1470. transform: translateX(-50%);
  1471. font-size: 2.1em;
  1472. }
  1473. #ratings {
  1474. span {
  1475. font-size: 1.68rem;
  1476. }
  1477. i {
  1478. color: #9e9e9e !important;
  1479. cursor: pointer;
  1480. transition: 0.1s color;
  1481. }
  1482. }
  1483. #time-display {
  1484. margin-top: 30px;
  1485. float: right;
  1486. }
  1487. #thumbs_up:hover,
  1488. #thumbs_up.liked {
  1489. color: #87d37c !important;
  1490. }
  1491. #thumbs_down:hover,
  1492. #thumbs_down.disliked {
  1493. color: #ec644b !important;
  1494. }
  1495. #song-thumbnail {
  1496. max-width: 100%;
  1497. width: 85%;
  1498. }
  1499. .seeker-bar-container {
  1500. position: relative;
  1501. height: 7px;
  1502. display: block;
  1503. width: 100%;
  1504. overflow: hidden;
  1505. }
  1506. .seeker-bar {
  1507. top: 0;
  1508. left: 0;
  1509. bottom: 0;
  1510. position: absolute;
  1511. }
  1512. ul {
  1513. list-style: none;
  1514. margin: 0;
  1515. display: block;
  1516. }
  1517. h1,
  1518. h2,
  1519. h3,
  1520. h4,
  1521. h5,
  1522. h6 {
  1523. font-weight: 400;
  1524. line-height: 1.1;
  1525. }
  1526. h1 a,
  1527. h2 a,
  1528. h3 a,
  1529. h4 a,
  1530. h5 a,
  1531. h6 a {
  1532. font-weight: inherit;
  1533. }
  1534. h1 {
  1535. font-size: 4.2rem;
  1536. line-height: 110%;
  1537. margin: 2.1rem 0 1.68rem 0;
  1538. }
  1539. h2 {
  1540. font-size: 3.56rem;
  1541. line-height: 110%;
  1542. margin: 1.78rem 0 1.424rem 0;
  1543. }
  1544. h3 {
  1545. font-size: 2.92rem;
  1546. line-height: 110%;
  1547. margin: 1.46rem 0 1.168rem 0;
  1548. }
  1549. h4 {
  1550. font-size: 2.28rem;
  1551. line-height: 110%;
  1552. margin: 1.14rem 0 0.912rem 0;
  1553. }
  1554. h5 {
  1555. font-size: 1.64rem;
  1556. line-height: 110%;
  1557. margin: 0.82rem 0 0.656rem 0;
  1558. }
  1559. h6 {
  1560. font-size: 1rem;
  1561. line-height: 110%;
  1562. margin: 0.5rem 0 0.4rem 0;
  1563. }
  1564. .thin {
  1565. font-weight: 200;
  1566. }
  1567. .left {
  1568. float: left !important;
  1569. }
  1570. .right {
  1571. float: right !important;
  1572. }
  1573. .light-blue {
  1574. background-color: #03a9f4 !important;
  1575. }
  1576. .white {
  1577. background-color: #ffffff !important;
  1578. }
  1579. .btn-search {
  1580. font-size: 14px;
  1581. }
  1582. .menu {
  1583. padding: 0 10px;
  1584. }
  1585. .menu-list li a:hover {
  1586. color: #000 !important;
  1587. }
  1588. .menu-list li {
  1589. display: flex;
  1590. justify-content: space-between;
  1591. }
  1592. .menu-list a {
  1593. /*padding: 0 10px !important;*/
  1594. }
  1595. .menu-list a:hover {
  1596. background-color: transparent;
  1597. }
  1598. .icons-group {
  1599. display: flex;
  1600. }
  1601. #like,
  1602. #dislike {
  1603. position: relative;
  1604. }
  1605. .behind {
  1606. z-index: -1;
  1607. }
  1608. .behind:focus {
  1609. z-index: 0;
  1610. }
  1611. .progress {
  1612. width: 50px;
  1613. animation: rotate 0.8s infinite linear;
  1614. border: 8px solid #03a9f4;
  1615. border-right-color: transparent;
  1616. height: 50px;
  1617. position: absolute;
  1618. top: 50%;
  1619. left: 50%;
  1620. }
  1621. @keyframes rotate {
  1622. 0% {
  1623. transform: rotate(0deg);
  1624. }
  1625. 100% {
  1626. transform: rotate(360deg);
  1627. }
  1628. }
  1629. .experimental {
  1630. display: none !important;
  1631. }
  1632. </style>