Station.vue 39 KB

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