Station.vue 38 KB

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