Station.vue 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759
  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 d = moment.duration(duration, "seconds");
  619. if (duration < 0) return "0:00";
  620. return `${
  621. d.hours() > 0
  622. ? d.hours() < 10
  623. ? `0${d.hours()}:`
  624. : `${d.hours()}:`
  625. : ""
  626. }${d.minutes()}:${
  627. d.seconds() < 10 ? `0${d.seconds()}` : d.seconds()
  628. }`;
  629. },
  630. calculateTimeElapsed() {
  631. const local = this;
  632. if (
  633. local.playerReady &&
  634. local.currentSong &&
  635. local.player.getPlayerState() === -1
  636. ) {
  637. if (local.attemptsToPlayVideo >= 5) {
  638. if (
  639. Date.now() - local.lastTimeRequestedIfCanAutoplay >
  640. 2000
  641. ) {
  642. local.lastTimeRequestedIfCanAutoplay = Date.now();
  643. window.canAutoplay.video().then(({ result }) => {
  644. if (result) {
  645. local.attemptsToPlayVideo = 0;
  646. local.canAutoplay = true;
  647. } else {
  648. local.canAutoplay = false;
  649. }
  650. });
  651. }
  652. } else {
  653. local.player.playVideo();
  654. local.attemptsToPlayVideo += 1;
  655. }
  656. }
  657. if (!local.paused) {
  658. const timeElapsed = local.getTimeElapsed();
  659. const currentPlayerTime = local.player.getCurrentTime() * 1000;
  660. const difference = timeElapsed - currentPlayerTime;
  661. // console.log(difference123);
  662. if (difference < -200) {
  663. // console.log("Difference0.8");
  664. local.player.setPlaybackRate(0.8);
  665. } else if (difference < -50) {
  666. // console.log("Difference0.9");
  667. local.player.setPlaybackRate(0.9);
  668. } else if (difference < -25) {
  669. // console.log("Difference0.99");
  670. local.player.setPlaybackRate(0.99);
  671. } else if (difference > 200) {
  672. // console.log("Difference1.2");
  673. local.player.setPlaybackRate(1.2);
  674. } else if (difference > 50) {
  675. // console.log("Difference1.1");
  676. local.player.setPlaybackRate(1.1);
  677. } else if (difference > 25) {
  678. // console.log("Difference1.01");
  679. local.player.setPlaybackRate(1.01);
  680. } else if (local.player.getPlaybackRate !== 1.0) {
  681. // console.log("NDifference1.0");
  682. local.player.setPlaybackRate(1.0);
  683. }
  684. }
  685. /* if (local.currentTime !== undefined && local.paused) {
  686. local.timePaused += Date.currently() - local.currentTime;
  687. local.currentTime = undefined;
  688. } */
  689. let { timePaused } = local;
  690. if (local.paused) timePaused += Date.currently() - local.pausedAt;
  691. const duration =
  692. (Date.currently() - local.startedAt - timePaused) / 1000;
  693. const songDuration = local.currentSong.duration;
  694. if (songDuration <= duration) local.player.pauseVideo();
  695. if (!local.paused && duration <= songDuration)
  696. local.timeElapsed = local.formatTime(duration);
  697. },
  698. toggleLock() {
  699. window.socket.emit("stations.toggleLock", this.station._id, res => {
  700. if (res.status === "success") {
  701. Toast.methods.addToast(
  702. "Successfully toggled the queue lock.",
  703. 4000
  704. );
  705. } else Toast.methods.addToast(res.message, 8000);
  706. });
  707. },
  708. changeVolume() {
  709. const local = this;
  710. const volume = document.getElementById("volumeSlider").value;
  711. localStorage.setItem("volume", volume / 100);
  712. if (local.playerReady) {
  713. local.player.setVolume(volume / 100);
  714. if (volume > 0) {
  715. local.player.unMute();
  716. localStorage.setItem("muted", false);
  717. local.muted = false;
  718. }
  719. }
  720. },
  721. resumeLocalStation() {
  722. this.paused = false;
  723. if (!this.noSong) {
  724. if (this.playerReady) {
  725. this.player.seekTo(
  726. this.getTimeElapsed() / 1000 +
  727. this.currentSong.skipDuration
  728. );
  729. this.player.playVideo();
  730. }
  731. }
  732. },
  733. pauseLocalStation() {
  734. this.paused = true;
  735. if (!this.noSong) {
  736. this.timeBeforePause = this.getTimeElapsed();
  737. if (this.playerReady) this.player.pauseVideo();
  738. }
  739. },
  740. skipStation() {
  741. const _this = this;
  742. _this.socket.emit("stations.forceSkip", _this.station._id, data => {
  743. if (data.status !== "success")
  744. Toast.methods.addToast(`Error: ${data.message}`, 8000);
  745. else
  746. Toast.methods.addToast(
  747. "Successfully skipped the station's current song.",
  748. 4000
  749. );
  750. });
  751. },
  752. voteSkipStation() {
  753. const _this = this;
  754. _this.socket.emit("stations.voteSkip", _this.station._id, data => {
  755. if (data.status !== "success")
  756. Toast.methods.addToast(`Error: ${data.message}`, 8000);
  757. else
  758. Toast.methods.addToast(
  759. "Successfully voted to skip the current song.",
  760. 4000
  761. );
  762. });
  763. },
  764. resumeStation() {
  765. const _this = this;
  766. _this.socket.emit("stations.resume", _this.station._id, data => {
  767. if (data.status !== "success")
  768. Toast.methods.addToast(`Error: ${data.message}`, 8000);
  769. else
  770. Toast.methods.addToast(
  771. "Successfully resumed the station.",
  772. 4000
  773. );
  774. });
  775. },
  776. pauseStation() {
  777. const _this = this;
  778. _this.socket.emit("stations.pause", _this.station._id, data => {
  779. if (data.status !== "success")
  780. Toast.methods.addToast(`Error: ${data.message}`, 8000);
  781. else
  782. Toast.methods.addToast(
  783. "Successfully paused the station.",
  784. 4000
  785. );
  786. });
  787. },
  788. toggleMute() {
  789. if (this.playerReady) {
  790. const previousVolume = parseFloat(
  791. localStorage.getItem("volume")
  792. );
  793. const volume =
  794. this.player.getVolume() * 100 <= 0 ? previousVolume : 0;
  795. this.muted = !this.muted;
  796. localStorage.setItem("muted", this.muted);
  797. document.getElementById("volumeSlider").value = volume * 100;
  798. this.player.setVolume(volume);
  799. if (!this.muted) localStorage.setItem("volume", volume);
  800. }
  801. },
  802. increaseVolume() {
  803. if (this.playerReady) {
  804. const previousVolume = parseInt(localStorage.getItem("volume"));
  805. let volume = previousVolume + 5;
  806. if (previousVolume === 0) {
  807. this.muted = false;
  808. localStorage.setItem("muted", false);
  809. }
  810. if (volume > 100) volume = 100;
  811. document.getElementById("volumeSlider").value = volume * 100;
  812. this.player.setVolume(volume);
  813. localStorage.setItem("volume", volume);
  814. }
  815. },
  816. toggleLike() {
  817. const _this = this;
  818. if (_this.liked)
  819. _this.socket.emit(
  820. "songs.unlike",
  821. _this.currentSong.songId,
  822. data => {
  823. if (data.status !== "success")
  824. Toast.methods.addToast(
  825. `Error: ${data.message}`,
  826. 8000
  827. );
  828. }
  829. );
  830. else
  831. _this.socket.emit(
  832. "songs.like",
  833. _this.currentSong.songId,
  834. data => {
  835. if (data.status !== "success")
  836. Toast.methods.addToast(
  837. `Error: ${data.message}`,
  838. 8000
  839. );
  840. }
  841. );
  842. },
  843. toggleDislike() {
  844. const _this = this;
  845. if (_this.disliked)
  846. return _this.socket.emit(
  847. "songs.undislike",
  848. _this.currentSong.songId,
  849. data => {
  850. if (data.status !== "success")
  851. Toast.methods.addToast(
  852. `Error: ${data.message}`,
  853. 8000
  854. );
  855. }
  856. );
  857. return _this.socket.emit(
  858. "songs.dislike",
  859. _this.currentSong.songId,
  860. data => {
  861. if (data.status !== "success")
  862. Toast.methods.addToast(`Error: ${data.message}`, 8000);
  863. }
  864. );
  865. },
  866. addFirstPrivatePlaylistSongToQueue() {
  867. const _this = this;
  868. let isInQueue = false;
  869. const { userId } = _this.$parent;
  870. if (_this.type === "community") {
  871. _this.songsList.forEach(queueSong => {
  872. if (queueSong.requestedBy === userId) isInQueue = true;
  873. });
  874. if (!isInQueue && _this.privatePlaylistQueueSelected) {
  875. _this.socket.emit(
  876. "playlists.getFirstSong",
  877. _this.privatePlaylistQueueSelected,
  878. data => {
  879. if (data.status === "success") {
  880. if (data.song.duration < 15 * 60) {
  881. _this.automaticallyRequestedSongId =
  882. data.song.songId;
  883. _this.socket.emit(
  884. "stations.addToQueue",
  885. _this.station._id,
  886. data.song.songId,
  887. data2 => {
  888. if (data2.status === "success") {
  889. _this.socket.emit(
  890. "playlists.moveSongToBottom",
  891. _this.privatePlaylistQueueSelected,
  892. data.song.songId,
  893. data3 => {
  894. if (
  895. data3.status ===
  896. "success"
  897. ) {} // eslint-disable-line
  898. }
  899. );
  900. }
  901. }
  902. );
  903. } else {
  904. Toast.methods.addToast(
  905. `Top song in playlist was too long to be added.`,
  906. 3000
  907. );
  908. _this.socket.emit(
  909. "playlists.moveSongToBottom",
  910. _this.privatePlaylistQueueSelected,
  911. data.song.songId,
  912. data3 => {
  913. if (data3.status === "success") {
  914. setTimeout(() => {
  915. this.addFirstPrivatePlaylistSongToQueue();
  916. }, 3000);
  917. }
  918. }
  919. );
  920. }
  921. }
  922. }
  923. );
  924. }
  925. }
  926. },
  927. join() {
  928. const _this = this;
  929. _this.socket.emit("stations.join", _this.stationName, res => {
  930. if (res.status === "success") {
  931. _this.loading = false;
  932. const {
  933. _id,
  934. displayName,
  935. description,
  936. privacy,
  937. locked,
  938. partyMode,
  939. owner,
  940. privatePlaylist
  941. } = res.data;
  942. document.title = `Musare - ${displayName}`;
  943. _this.joinStation({
  944. _id,
  945. name: _this.stationName,
  946. displayName,
  947. description,
  948. privacy,
  949. locked,
  950. partyMode,
  951. owner,
  952. privatePlaylist
  953. });
  954. _this.currentSong = res.data.currentSong
  955. ? res.data.currentSong
  956. : {};
  957. if (_this.currentSong.artists)
  958. _this.currentSong.artists = _this.currentSong.artists.join(
  959. ", "
  960. );
  961. _this.type = res.data.type;
  962. _this.startedAt = res.data.startedAt;
  963. _this.paused = res.data.paused;
  964. _this.timePaused = res.data.timePaused;
  965. _this.userCount = res.data.userCount;
  966. _this.users = res.data.users;
  967. _this.pausedAt = res.data.pausedAt;
  968. if (res.data.currentSong) {
  969. _this.noSong = false;
  970. _this.simpleSong =
  971. res.data.currentSong.likes === -1 &&
  972. res.data.currentSong.dislikes === -1;
  973. if (_this.simpleSong) {
  974. _this.currentSong.skipDuration = 0;
  975. }
  976. _this.youtubeReady();
  977. _this.playVideo();
  978. _this.socket.emit(
  979. "songs.getOwnSongRatings",
  980. res.data.currentSong.songId,
  981. data => {
  982. if (_this.currentSong.songId === data.songId) {
  983. _this.liked = data.liked;
  984. _this.disliked = data.disliked;
  985. }
  986. }
  987. );
  988. } else {
  989. if (_this.playerReady) _this.player.pauseVideo();
  990. _this.noSong = true;
  991. }
  992. // UNIX client time before ping
  993. const beforePing = Date.now();
  994. _this.socket.emit("apis.ping", pong => {
  995. // UNIX client time after ping
  996. const afterPing = Date.now();
  997. // Average time in MS it took between the server responding and the client receiving
  998. const connectionLatency = (afterPing - beforePing) / 2;
  999. console.log(connectionLatency, beforePing - afterPing);
  1000. // UNIX server time
  1001. const serverDate = pong.date;
  1002. // Difference between the server UNIX time and the client UNIX time after ping, with the connectionLatency added to the server UNIX time
  1003. const difference =
  1004. serverDate + connectionLatency - afterPing;
  1005. console.log("Difference: ", difference);
  1006. if (difference > 3000 || difference < -3000) {
  1007. console.log(
  1008. "System time difference is bigger than 3 seconds."
  1009. );
  1010. }
  1011. _this.systemDifference = difference;
  1012. });
  1013. }
  1014. });
  1015. },
  1016. ...mapActions("modals", ["openModal"]),
  1017. ...mapActions("station", ["joinStation"])
  1018. },
  1019. mounted() {
  1020. const _this = this;
  1021. Date.currently = () => {
  1022. return new Date().getTime() + _this.systemDifference;
  1023. };
  1024. _this.stationName = _this.$route.params.id;
  1025. window.stationInterval = 0;
  1026. io.getSocket(socket => {
  1027. _this.socket = socket;
  1028. io.removeAllListeners();
  1029. if (_this.socket.connected) _this.join();
  1030. io.onConnect(_this.join);
  1031. _this.socket.emit("stations.findByName", _this.stationName, res => {
  1032. if (res.status === "failure") {
  1033. _this.loading = false;
  1034. _this.exists = false;
  1035. } else {
  1036. _this.exists = true;
  1037. }
  1038. });
  1039. _this.socket.on("event:songs.next", data => {
  1040. _this.previousSong = _this.currentSong.songId
  1041. ? _this.currentSong
  1042. : null;
  1043. _this.currentSong = data.currentSong ? data.currentSong : {};
  1044. _this.startedAt = data.startedAt;
  1045. _this.paused = data.paused;
  1046. _this.timePaused = data.timePaused;
  1047. if (data.currentSong) {
  1048. _this.noSong = false;
  1049. if (_this.currentSong.artists)
  1050. _this.currentSong.artists = _this.currentSong.artists.join(
  1051. ", "
  1052. );
  1053. _this.simpleSong =
  1054. data.currentSong.likes === -1 &&
  1055. data.currentSong.dislikes === -1;
  1056. if (_this.simpleSong) _this.currentSong.skipDuration = 0;
  1057. if (!_this.playerReady) _this.youtubeReady();
  1058. else _this.playVideo();
  1059. _this.socket.emit(
  1060. "songs.getOwnSongRatings",
  1061. data.currentSong.songId,
  1062. song => {
  1063. if (_this.currentSong.songId === song.songId) {
  1064. _this.liked = song.liked;
  1065. _this.disliked = song.disliked;
  1066. }
  1067. }
  1068. );
  1069. } else {
  1070. if (_this.playerReady) _this.player.pauseVideo();
  1071. _this.noSong = true;
  1072. }
  1073. let isInQueue = false;
  1074. const { userId } = _this.$parent;
  1075. _this.songsList.forEach(queueSong => {
  1076. if (queueSong.requestedBy === userId) isInQueue = true;
  1077. });
  1078. if (
  1079. !isInQueue &&
  1080. _this.privatePlaylistQueueSelected &&
  1081. (_this.automaticallyRequestedSongId !==
  1082. _this.currentSong.songId ||
  1083. !_this.currentSong.songId)
  1084. ) {
  1085. _this.addFirstPrivatePlaylistSongToQueue();
  1086. }
  1087. });
  1088. _this.socket.on("event:stations.pause", data => {
  1089. _this.pausedAt = data.pausedAt;
  1090. _this.pauseLocalStation();
  1091. });
  1092. _this.socket.on("event:stations.resume", data => {
  1093. _this.timePaused = data.timePaused;
  1094. _this.resumeLocalStation();
  1095. });
  1096. _this.socket.on("event:stations.remove", () => {
  1097. window.location.href = "/";
  1098. return true;
  1099. });
  1100. _this.socket.on("event:song.like", data => {
  1101. if (!this.noSong) {
  1102. if (data.songId === _this.currentSong.songId) {
  1103. _this.currentSong.dislikes = data.dislikes;
  1104. _this.currentSong.likes = data.likes;
  1105. }
  1106. }
  1107. });
  1108. _this.socket.on("event:song.dislike", data => {
  1109. if (!this.noSong) {
  1110. if (data.songId === _this.currentSong.songId) {
  1111. _this.currentSong.dislikes = data.dislikes;
  1112. _this.currentSong.likes = data.likes;
  1113. }
  1114. }
  1115. });
  1116. _this.socket.on("event:song.unlike", data => {
  1117. if (!this.noSong) {
  1118. if (data.songId === _this.currentSong.songId) {
  1119. _this.currentSong.dislikes = data.dislikes;
  1120. _this.currentSong.likes = data.likes;
  1121. }
  1122. }
  1123. });
  1124. _this.socket.on("event:song.undislike", data => {
  1125. if (!this.noSong) {
  1126. if (data.songId === _this.currentSong.songId) {
  1127. _this.currentSong.dislikes = data.dislikes;
  1128. _this.currentSong.likes = data.likes;
  1129. }
  1130. }
  1131. });
  1132. _this.socket.on("event:song.newRatings", data => {
  1133. if (!this.noSong) {
  1134. if (data.songId === _this.currentSong.songId) {
  1135. _this.liked = data.liked;
  1136. _this.disliked = data.disliked;
  1137. }
  1138. }
  1139. });
  1140. _this.socket.on("event:queue.update", queue => {
  1141. if (this.type === "community") this.songsList = queue;
  1142. });
  1143. _this.socket.on("event:song.voteSkipSong", () => {
  1144. if (this.currentSong) this.currentSong.skipVotes += 1;
  1145. });
  1146. _this.socket.on("event:privatePlaylist.selected", playlistId => {
  1147. if (this.type === "community") {
  1148. this.station.privatePlaylist = playlistId;
  1149. }
  1150. });
  1151. _this.socket.on("event:partyMode.updated", partyMode => {
  1152. if (this.type === "community") {
  1153. this.station.partyMode = partyMode;
  1154. }
  1155. });
  1156. _this.socket.on("event:newOfficialPlaylist", playlist => {
  1157. if (this.type === "official") {
  1158. this.songsList = playlist;
  1159. }
  1160. });
  1161. _this.socket.on("event:users.updated", users => {
  1162. _this.users = users;
  1163. });
  1164. _this.socket.on("event:userCount.updated", userCount => {
  1165. _this.userCount = userCount;
  1166. });
  1167. _this.socket.on("event:queueLockToggled", locked => {
  1168. _this.station.locked = locked;
  1169. });
  1170. });
  1171. if (JSON.parse(localStorage.getItem("muted"))) {
  1172. this.muted = true;
  1173. this.player.setVolume(0);
  1174. document.getElementById("volumeSlider").value = 0 * 100;
  1175. } else {
  1176. let volume = parseFloat(localStorage.getItem("volume"));
  1177. volume =
  1178. typeof volume === "number" && !Number.isNaN(volume)
  1179. ? volume
  1180. : 20;
  1181. localStorage.setItem("volume", volume);
  1182. document.getElementById("volumeSlider").value = volume * 100;
  1183. }
  1184. },
  1185. components: {
  1186. OfficialHeader,
  1187. CommunityHeader,
  1188. SongQueue,
  1189. AddToPlaylist,
  1190. EditPlaylist,
  1191. CreatePlaylist,
  1192. EditStation,
  1193. Report,
  1194. SongsListSidebar,
  1195. PlaylistSidebar,
  1196. UsersSidebar,
  1197. UserIdToUsername,
  1198. Z404
  1199. }
  1200. };
  1201. </script>
  1202. <style lang="scss">
  1203. .player-can-not-autoplay {
  1204. position: absolute;
  1205. width: 100%;
  1206. height: 100%;
  1207. background: rgba(3, 169, 244, 0.95);
  1208. display: flex;
  1209. align-items: center;
  1210. justify-content: center;
  1211. p {
  1212. color: white;
  1213. font-size: 26px;
  1214. text-align: center;
  1215. }
  1216. }
  1217. .slide-enter-active,
  1218. .slide-leave-active {
  1219. transition: all 0.3s ease;
  1220. }
  1221. .slide-enter,
  1222. .slide-leave-to {
  1223. transform: translateX(300px);
  1224. }
  1225. .no-song {
  1226. color: #03a9f4;
  1227. text-align: center;
  1228. }
  1229. #volumeSlider {
  1230. padding: 0 15px;
  1231. background: transparent;
  1232. }
  1233. .volume-slider-wrapper {
  1234. margin-top: 0;
  1235. position: relative;
  1236. display: flex;
  1237. align-items: center;
  1238. .material-icons {
  1239. user-select: none;
  1240. }
  1241. }
  1242. .material-icons {
  1243. cursor: pointer;
  1244. }
  1245. .stationDisplayName {
  1246. color: white !important;
  1247. }
  1248. .add-to-playlist {
  1249. display: flex;
  1250. align-items: center;
  1251. justify-content: center;
  1252. }
  1253. .slideout {
  1254. top: 50px;
  1255. height: 100%;
  1256. position: fixed;
  1257. right: 0;
  1258. width: 350px;
  1259. background-color: white;
  1260. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16),
  1261. 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  1262. .slideout-header {
  1263. text-align: center;
  1264. background-color: rgb(3, 169, 244) !important;
  1265. margin: 0;
  1266. padding-top: 5px;
  1267. padding-bottom: 7px;
  1268. color: white;
  1269. }
  1270. .slideout-content {
  1271. height: 100%;
  1272. }
  1273. }
  1274. .modal-large {
  1275. width: 75%;
  1276. }
  1277. .station {
  1278. flex: 1 0 auto;
  1279. padding-top: 0.5vw;
  1280. transition: all 0.1s;
  1281. margin: 0 auto;
  1282. max-width: 100%;
  1283. width: 90%;
  1284. @media only screen and (min-width: 993px) {
  1285. width: 70%;
  1286. }
  1287. @media only screen and (min-width: 601px) {
  1288. width: 85%;
  1289. }
  1290. @media (min-width: 999px) {
  1291. .mobile-only {
  1292. display: none;
  1293. }
  1294. .desktop-only {
  1295. display: block;
  1296. }
  1297. }
  1298. @media (max-width: 998px) {
  1299. .mobile-only {
  1300. display: block;
  1301. }
  1302. .desktop-only {
  1303. display: none;
  1304. visibility: hidden;
  1305. }
  1306. }
  1307. .mobile-only {
  1308. text-align: center;
  1309. }
  1310. .playlistCard {
  1311. margin: 10px;
  1312. position: relative;
  1313. padding-bottom: calc(31.25% + 7px);
  1314. height: 0;
  1315. overflow-y: scroll;
  1316. .title {
  1317. background-color: rgb(3, 169, 244);
  1318. text-align: center;
  1319. padding: 10px;
  1320. color: white;
  1321. font-weight: 600;
  1322. }
  1323. .media {
  1324. padding: 0 25px;
  1325. }
  1326. .media-content .content {
  1327. min-height: 64px;
  1328. max-height: 64px;
  1329. display: flex;
  1330. align-items: center;
  1331. }
  1332. .content p strong {
  1333. word-break: break-word;
  1334. }
  1335. .content p small {
  1336. word-break: break-word;
  1337. }
  1338. .add-to-queue {
  1339. width: 100%;
  1340. margin-top: 25px;
  1341. height: 40px;
  1342. border-radius: 0;
  1343. background: rgb(3, 169, 244);
  1344. color: #fff !important;
  1345. border: 0;
  1346. &:active,
  1347. &:focus {
  1348. border: 0;
  1349. }
  1350. }
  1351. .add-to-queue:focus {
  1352. background: #029ce3;
  1353. }
  1354. .media-right {
  1355. line-height: 64px;
  1356. }
  1357. .songTitle {
  1358. word-wrap: break-word;
  1359. overflow: hidden;
  1360. text-overflow: ellipsis;
  1361. display: -webkit-box;
  1362. -webkit-box-orient: vertical;
  1363. -webkit-line-clamp: 2;
  1364. line-height: 20px;
  1365. max-height: 40px;
  1366. width: 100%;
  1367. }
  1368. }
  1369. input[type="range"] {
  1370. -webkit-appearance: none;
  1371. width: 100%;
  1372. margin: 7.3px 0;
  1373. }
  1374. input[type="range"]:focus {
  1375. outline: none;
  1376. }
  1377. input[type="range"]::-webkit-slider-runnable-track {
  1378. width: 100%;
  1379. height: 5.2px;
  1380. cursor: pointer;
  1381. box-shadow: 0;
  1382. background: #c2c0c2;
  1383. border-radius: 0;
  1384. border: 0;
  1385. }
  1386. input[type="range"]::-webkit-slider-thumb {
  1387. box-shadow: 0;
  1388. border: 0;
  1389. height: 19px;
  1390. width: 19px;
  1391. border-radius: 15px;
  1392. background: #03a9f4;
  1393. cursor: pointer;
  1394. -webkit-appearance: none;
  1395. margin-top: -6.5px;
  1396. }
  1397. input[type="range"]::-moz-range-track {
  1398. width: 100%;
  1399. height: 5.2px;
  1400. cursor: pointer;
  1401. box-shadow: 0;
  1402. background: #c2c0c2;
  1403. border-radius: 0;
  1404. border: 0;
  1405. }
  1406. input[type="range"]::-moz-range-thumb {
  1407. box-shadow: 0;
  1408. border: 0;
  1409. height: 19px;
  1410. width: 19px;
  1411. border-radius: 15px;
  1412. background: #03a9f4;
  1413. cursor: pointer;
  1414. -webkit-appearance: none;
  1415. margin-top: -6.5px;
  1416. }
  1417. input[type="range"]::-ms-track {
  1418. width: 100%;
  1419. height: 5.2px;
  1420. cursor: pointer;
  1421. box-shadow: 0;
  1422. background: #c2c0c2;
  1423. border-radius: 1.3px;
  1424. }
  1425. input[type="range"]::-ms-fill-lower {
  1426. background: #c2c0c2;
  1427. border: 0;
  1428. border-radius: 0;
  1429. box-shadow: 0;
  1430. }
  1431. input[type="range"]::-ms-fill-upper {
  1432. background: #c2c0c2;
  1433. border: 0;
  1434. border-radius: 0;
  1435. box-shadow: 0;
  1436. }
  1437. input[type="range"]::-ms-thumb {
  1438. box-shadow: 0;
  1439. border: 0;
  1440. height: 15px;
  1441. width: 15px;
  1442. border-radius: 15px;
  1443. background: #03a9f4;
  1444. cursor: pointer;
  1445. -webkit-appearance: none;
  1446. margin-top: 1.5px;
  1447. }
  1448. .video-container {
  1449. position: relative;
  1450. padding-bottom: 56.25%;
  1451. height: 0;
  1452. overflow: hidden;
  1453. iframe {
  1454. position: absolute;
  1455. top: 0;
  1456. left: 0;
  1457. width: 100%;
  1458. height: 100%;
  1459. }
  1460. }
  1461. .video-col {
  1462. padding-right: 0.75rem;
  1463. padding-left: 0.75rem;
  1464. }
  1465. }
  1466. .room-title {
  1467. left: 50%;
  1468. -webkit-transform: translateX(-50%);
  1469. transform: translateX(-50%);
  1470. font-size: 2.1em;
  1471. }
  1472. #ratings {
  1473. span {
  1474. font-size: 1.68rem;
  1475. }
  1476. i {
  1477. color: #9e9e9e !important;
  1478. cursor: pointer;
  1479. transition: 0.1s color;
  1480. }
  1481. }
  1482. #time-display {
  1483. margin-top: 30px;
  1484. float: right;
  1485. }
  1486. #thumbs_up:hover,
  1487. #thumbs_up.liked {
  1488. color: #87d37c !important;
  1489. }
  1490. #thumbs_down:hover,
  1491. #thumbs_down.disliked {
  1492. color: #ec644b !important;
  1493. }
  1494. #song-thumbnail {
  1495. max-width: 100%;
  1496. width: 85%;
  1497. }
  1498. .seeker-bar-container {
  1499. position: relative;
  1500. height: 7px;
  1501. display: block;
  1502. width: 100%;
  1503. overflow: hidden;
  1504. }
  1505. .seeker-bar {
  1506. top: 0;
  1507. left: 0;
  1508. bottom: 0;
  1509. position: absolute;
  1510. }
  1511. ul {
  1512. list-style: none;
  1513. margin: 0;
  1514. display: block;
  1515. }
  1516. h1,
  1517. h2,
  1518. h3,
  1519. h4,
  1520. h5,
  1521. h6 {
  1522. font-weight: 400;
  1523. line-height: 1.1;
  1524. }
  1525. h1 a,
  1526. h2 a,
  1527. h3 a,
  1528. h4 a,
  1529. h5 a,
  1530. h6 a {
  1531. font-weight: inherit;
  1532. }
  1533. h1 {
  1534. font-size: 4.2rem;
  1535. line-height: 110%;
  1536. margin: 2.1rem 0 1.68rem 0;
  1537. }
  1538. h2 {
  1539. font-size: 3.56rem;
  1540. line-height: 110%;
  1541. margin: 1.78rem 0 1.424rem 0;
  1542. }
  1543. h3 {
  1544. font-size: 2.92rem;
  1545. line-height: 110%;
  1546. margin: 1.46rem 0 1.168rem 0;
  1547. }
  1548. h4 {
  1549. font-size: 2.28rem;
  1550. line-height: 110%;
  1551. margin: 1.14rem 0 0.912rem 0;
  1552. }
  1553. h5 {
  1554. font-size: 1.64rem;
  1555. line-height: 110%;
  1556. margin: 0.82rem 0 0.656rem 0;
  1557. }
  1558. h6 {
  1559. font-size: 1rem;
  1560. line-height: 110%;
  1561. margin: 0.5rem 0 0.4rem 0;
  1562. }
  1563. .thin {
  1564. font-weight: 200;
  1565. }
  1566. .left {
  1567. float: left !important;
  1568. }
  1569. .right {
  1570. float: right !important;
  1571. }
  1572. .light-blue {
  1573. background-color: #03a9f4 !important;
  1574. }
  1575. .white {
  1576. background-color: #ffffff !important;
  1577. }
  1578. .btn-search {
  1579. font-size: 14px;
  1580. }
  1581. .menu {
  1582. padding: 0 10px;
  1583. }
  1584. .menu-list li a:hover {
  1585. color: #000 !important;
  1586. }
  1587. .menu-list li {
  1588. display: flex;
  1589. justify-content: space-between;
  1590. }
  1591. .menu-list a {
  1592. /*padding: 0 10px !important;*/
  1593. }
  1594. .menu-list a:hover {
  1595. background-color: transparent;
  1596. }
  1597. .icons-group {
  1598. display: flex;
  1599. }
  1600. #like,
  1601. #dislike {
  1602. position: relative;
  1603. }
  1604. .behind {
  1605. z-index: -1;
  1606. }
  1607. .behind:focus {
  1608. z-index: 0;
  1609. }
  1610. .progress {
  1611. width: 50px;
  1612. animation: rotate 0.8s infinite linear;
  1613. border: 8px solid #03a9f4;
  1614. border-right-color: transparent;
  1615. height: 50px;
  1616. position: absolute;
  1617. top: 50%;
  1618. left: 50%;
  1619. }
  1620. @keyframes rotate {
  1621. 0% {
  1622. transform: rotate(0deg);
  1623. }
  1624. 100% {
  1625. transform: rotate(360deg);
  1626. }
  1627. }
  1628. .experimental {
  1629. display: none !important;
  1630. }
  1631. </style>