Browse Source

fix(MacOS): playback rates shouldn't be modified on-the-fly on Safari

Signed-off-by: Jonathan Graham <theflametrooper@gmail.com>
Jonathan Graham 3 years ago
parent
commit
40aa4e9432
2 changed files with 17 additions and 13 deletions
  1. 11 9
      frontend/src/App.vue
  2. 6 4
      frontend/src/pages/Station/index.vue

+ 11 - 9
frontend/src/App.vue

@@ -135,8 +135,12 @@ export default {
 		});
 
 		if (localStorage.getItem("github_redirect")) {
-			setTimeout(() => 
-				this.$router.push(localStorage.getItem("github_redirect")), 50);
+			setTimeout(
+				() =>
+					this.$router.push(localStorage.getItem("github_redirect")),
+				50
+			);
+
 			localStorage.removeItem("github_redirect");
 		}
 
@@ -158,8 +162,6 @@ export default {
 
 		this.apiDomain = await lofig.get("apiDomain");
 
-		console.log(this.$route);
-
 		this.$router.isReady().then(() => {
 			if (this.$route.query.err) {
 				let { err } = this.$route.query;
@@ -270,12 +272,12 @@ export default {
 	}
 
 	// #toasts-container .toast {
-		// color: var(--dark-grey-2);
-		// background-color: var(--light-grey-3) !important;
+	// color: var(--dark-grey-2);
+	// background-color: var(--light-grey-3) !important;
 
-		// &:last-of-type {
-		// 	background-color: var(--light-grey) !important;
-		// }
+	// &:last-of-type {
+	// 	background-color: var(--light-grey) !important;
+	// }
 	// }
 
 	h1,

+ 6 - 4
frontend/src/pages/Station/index.vue

@@ -367,7 +367,7 @@
 										}}
 									</p>
 								</div>
-								<p id="volume-control" v-if="!isIOS">
+								<p id="volume-control" v-if="!isApple">
 									<i
 										v-if="muted"
 										class="material-icons"
@@ -821,7 +821,9 @@ export default {
 	data() {
 		return {
 			utils,
-			isIOS: navigator.platform.match(/iPhone|iPod|iPad/),
+			isApple:
+				navigator.platform.match(/iPhone|iPod|iPad/) ||
+				navigator.vendor === "Apple Computer, Inc.",
 			title: "Station",
 			loading: true,
 			exists: true,
@@ -1467,7 +1469,7 @@ export default {
 							this.playVideo();
 
 							// on ios, playback will be forcibly paused locally
-							if (this.isIOS) {
+							if (this.isApple) {
 								this.updateLocalPaused(true);
 								new Toast(
 									"Please click play manually to use Musare on iOS."
@@ -1636,7 +1638,7 @@ export default {
 				!this.stationPaused &&
 				!this.localPaused &&
 				this.playerReady &&
-				!this.isIOS
+				!this.isApple
 			) {
 				const timeElapsed = this.getTimeElapsed();
 				const currentPlayerTime =