Merge pull request #1044 from ciderapp/develop

Develop
This commit is contained in:
vapormusic 2022-05-15 16:56:01 +07:00 committed by GitHub
commit fd20acdd87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 16115 additions and 21504 deletions

View file

@ -109,9 +109,9 @@
}
],
"build": {
"electronVersion": "18.2.2",
"electronVersion": "18.2.3",
"electronDownload": {
"version": "18.2.2+wvcus",
"version": "18.2.3+wvcus",
"mirror": "https://github.com/castlabs/electron-releases/releases/download/v"
},
"appId": "cider",

View file

@ -1076,6 +1076,11 @@ export class BrowserWindow {
BrowserWindow.win.setFullScreen(flag)
})
//Fullscreen
ipcMain.on('getFullScreen', (event, flag) => {
event.returnValue = BrowserWindow.win.isFullScreen()
})
//Fullscreen
ipcMain.on('detachDT', (_event, _) => {
BrowserWindow.win.webContents.openDevTools({mode: 'detach'});

File diff suppressed because it is too large Load diff

View file

@ -706,7 +706,7 @@ const CiderAudio = {
CiderAudio.audioNodes.spatialNode.connect(CiderAudio.audioNodes.audioBands[0]);
}
else {
CiderAudio.audioNodes.spatialgainNodeNode.connect(CiderAudio.audioNodes.audioBands[0]);
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.audioBands[0]);
}
break;
case 'h0':

View file

@ -29,6 +29,7 @@ const app = new Vue({
limit: 10
},
fullscreenLyrics: false,
fullscreenState: ipcRenderer.sendSync("getFullScreen"),
playerLCD: {
playbackDuration: 0,
desiredDuration: 0,
@ -235,7 +236,9 @@ const app = new Vue({
pages: [],
},
moreinfodata: [],
notyf: notyf
notyf: notyf,
idleTimer : null,
idleState : false,
},
watch: {
cfg: {
@ -957,12 +960,26 @@ const app = new Vue({
this.getBrowsePage();
this.$forceUpdate()
}, 500)
document.querySelector('#apple-music-video-player-controls').addEventListener('mousemove', () => {
this.showFoo('.music-player-info',2000);
})
ipcRenderer.invoke("renderer-ready", true)
document.querySelector("#LOADER").remove()
if (this.cfg.general.themeUpdateNotification && !this.isDev) {
this.checkForThemeUpdates()
}
},
showFoo(querySelector,time) {
clearTimeout(this.idleTimer);
if (this.idleState == true) {
document.querySelector(querySelector).classList.remove("inactive");
}
this.idleState = false;
this.idleTimer = setTimeout(() => {
document.querySelector(querySelector).classList.add("inactive");
this.idleState = true;
}, time);
},
setContentScrollPos(scroll) {
this.chrome.contentScrollPosY = scroll.target.scrollTop
},
@ -4135,10 +4152,11 @@ const app = new Vue({
});
},
fullscreen(flag) {
this.fullscreenState = flag;
if (flag) {
ipcRenderer.send('setFullScreen', true);
if (app.mk.nowPlayingItem.type && app.mk.nowPlayingItem.type.toLowerCase().includes("video")) {
document.querySelector('video#apple-music-video-player').requestFullscreen()
// document.querySelector('video#apple-music-video-player').requestFullscreen()
} else {
app.appMode = 'fullscreen';
}
@ -4149,8 +4167,20 @@ const app = new Vue({
});
} else {
ipcRenderer.send('setFullScreen', false);
if (app.mk.nowPlayingItem.type && app.mk.nowPlayingItem.type.toLowerCase().includes("video")) {
} else {
app.appMode = 'player';
}
}
},
pip(){
document.querySelector('video#apple-music-video-player').requestPictureInPicture()
// .then(pictureInPictureWindow => {
// pictureInPictureWindow.addEventListener("resize", () => {
// console.log("[PIP] Resized")
// }, false);
// })
},
miniPlayer(flag) {
if (flag) {

View file

@ -2971,12 +2971,81 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
float: left;
display: none;
width: 100%;
height: calc(100% - var(--chromeHeight));
height: 100%;
bottom: 0;
z-index: 100000;
}
#apple-music-video-container {
// AM Web Style Fullscreen Button
#player-fullscreen {
background-size : 50%;
background-position: center;
background-repeat : no-repeat;
filter : opacity(0.6);
// filter: drop-shadow(0px 0px 4px rgb(0 0 0 / 80%));
background-color : transparent;
border-radius : 10px;
transition : 0.2s ease-in-out filter;
bottom : 0;
&:hover {
filter : opacity(1);
transition: 0.2s ease-in-out filter;
}
}
// AM Web Style PiP Button
#player-pip {
background-color: transparent;
border-radius : 10px;
bottom : 0;
filter : opacity(0.6);
transition : 0.2s ease-in-out filter;
&:hover {
filter : opacity(1);
transition: 0.2s ease-in-out filter;
}
}
.playback-info{
position: absolute;
width:100%;
bottom: 0;
padding: 20px 40px;
background-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(0,0,0,0.5) 50%);
.song-artist{
font-size: 1.7rem;
font-weight: bold;
}
.song-name{
font-size: 1.2rem;
font-weight: bold;
color:rgb(255,255,255,0.8);
}
}
input[type="range"]{
align-self: center;
height: 4px;
border-radius: .5rem;
margin-inline: 10px;
}
.song-progress input[type="range"]{
appearance: initial;
&::-webkit-slider-thumb {
box-shadow: 0px 0px 0px #000000;
border: 1px solid #39404D;
background: #fff;
height:0.7rem;
width:0.7rem;
border-radius: 50%;
cursor: pointer;
-webkit-appearance: none;
}
}
}
#apple-music-video-player {
position: absolute;
@ -2990,13 +3059,66 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
top: var(--chromeHeight1);
bottom: unset;
}
.inactive {
opacity: 0;
}
#apple-music-video-player-controls {
position: absolute;
z-index: 100001;
float: left;
width: 100%;
height: 100%;
.playback-info{
.song-progress {
display: flex;
}
.app-chrome-item.display--large{
position: relative;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
.playback-button {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 3px;
}
}
.song-artist-album {
font-weight: 400;
font-size: 12px;
text-align: center;
/*height: 1.2em;
line-height: 1.2em;*/
z-index: 1;
align-items: center;
justify-content: center;
width: 80%;
max-width: 340px;
overflow: hidden;
.song-artist-album-content {
font-weight: 400;
font-size: 12px;
text-align: center;
width: 100%;
&.song-artist-normal {
height: inherit;
}
}
&.song-artist-marquee {
> marquee {
margin-bottom: -3px;
}
}
}
}
}
#apple-music-video-player-controls #player-exit {
@ -3016,7 +3138,6 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
margin: 10px;
right: 50px;
border-radius: 100%;
background: rgb(255 255 255 / 50%);
display: flex;
justify-content: center;
align-items: center;
@ -3035,7 +3156,6 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
margin: 10px;
right: 0px;
border-radius: 100%;
background: rgb(255 255 255 / 50%);
display: flex;
justify-content: center;
align-items: center;

View file

@ -62,16 +62,69 @@
:
'')}}
</div>
<div class="playback-info music-player-info">
<div class="song-artist-album-content"
style="display: inline-block; -webkit-box-orient: horizontal; white-space: nowrap;">
<div class="song-artist" style="display: inline-block">
{{ mk.nowPlayingItem?.attributes?.artistName ?? '' }}
</div>
</div>
<div class="song-name">
{{ mk.nowPlayingItem?.attributes?.name ?? '' }}
<div class="explicit-icon"
v-if="mk.nowPlayingItem?.attributes?.contentRating == 'explicit'"
style="display: inline-block"></div>
</div>
<div class="song-progress">
<p style="width: auto">{{ convertTime(getSongProgress()) }}</p>
<input type="range" step="0.01" min="0" :style="progressBarStyle()" style="width: 95%"
@input="playerLCD.desiredDuration = $event.target.value;playerLCD.userInteraction = true"
@mouseup="mk.seekToTime($event.target.value);setTimeout(()=>{playerLCD.desiredDuration = 0;playerLCD.userInteraction = false}, 1000);"
@touchend="mk.seekToTime($event.target.value);setTimeout(()=>{playerLCD.desiredDuration = 0;playerLCD.userInteraction = false}, 1000);"
:max="mk.currentPlaybackDuration" :value="getSongProgress()">
<p style="width: auto">{{ convertTime(mk.currentPlaybackDuration) }}
</div>
<div class="app-chrome-item display--large">
<div class="app-chrome-item volume display--large">
<button class="volume-button--small volume" @click="muteButtonPressed()"
:class="{'active': this.cfg.audio.volume == 0}"
:title="cfg.audio.muted ? $root.getLz('term.unmute') : $root.getLz('term.mute')"
v-b-tooltip.hover></button>
<input type="range" @wheel="volumeWheel" :step="cfg.audio.volumeStep" min="0" :max="cfg.audio.maxVolume"
v-model="mk.volume" v-if="typeof mk.volume != 'undefined'" @change="checkMuteChange()"
v-b-tooltip.hover :title="formatVolumeTooltip()">
</div>
<button class="playback-button pause" @click="mk.pause()" v-if="mk.isPlaying"
:title="$root.getLz('term.pause')" v-b-tooltip.hover></button>
<button class="playback-button play" @click="mk.play()" v-else
:title="$root.getLz('term.play')" v-b-tooltip.hover></button>
<div class="app-chrome-item generic">
<template v-if="lyrics && lyrics != [] && lyrics.length > 0">
<button class="playback-button--small lyrics"
:title="$root.getLz('term.lyrics')"
v-b-tooltip.hover
:class="{'active': drawer.panel == 'lyrics'}"
@click="invokeDrawer('lyrics')"></button>
</template>
<template v-else>
<button class="playback-button--small lyrics"
:style="{'opacity': 0.3, 'pointer-events': 'none'}"></button>
</template>
</div>
<div id="player-pip"
@click="document.querySelector('video#apple-music-video-player').requestPictureInPicture()"
title="Picture-in-Picture">
@click="pip()"
title="Picture-in-Picture"
v-b-tooltip.hover>
<%- include("../svg/pip.svg") %>
</div>
<div id="player-fullscreen"
@click="document.querySelector('video#apple-music-video-player').requestFullscreen()"
title="Fullscreen">
@click="fullscreen(!fullscreenState)"
title="Fullscreen"
v-b-tooltip.hover>
<%- include("../svg/fullscreen.svg") %>
</div>
</div>
</div>
</div>
<div id="apple-music-video-player"></div>
</div>

View file

@ -3,7 +3,7 @@
<div class="modal-window">
<div class="modal-header">
<div class="modal-title">{{$root.getLz('action.cast.todevices')}}</div>
<button class="close-btn" @click="close()" :aria-label="app.getLz('action.close')"></button>
<button class="close-btn" @click="close()" :aria-label="$root.getLz('action.close')"></button>
</div>
<div class="modal-content" style="overflow-y: overlay; padding: 3%">
<div class="md-labeltext">{{$root.getLz('action.cast.chromecast')}}</div>

View file

@ -2,8 +2,15 @@
<div class="mini-view" tabindex="0">
<div class="background">
</div>
<div class="player-pin" title="Pin to Top" @click="app.pinMiniPlayer()">
<span id="mini-pin">📌</span>
<div class="player-pin" title="Pin to Top" v-if="app.cfg.visual.miniplayer_top_toggle === false" @click="app.pinMiniPlayer()">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" fill="none" class="feather feather-pin">
<path d="M7.05664 16.3613C7.05664 17.1523 7.59277 17.6797 8.42773 17.6797H13.1299V21.8369C13.1299 23.0762 13.7539 24.3242 14 24.3242C14.2373 24.3242 14.8613 23.0762 14.8613 21.8369V17.6797H19.5635C20.3984 17.6797 20.9346 17.1523 20.9346 16.3613C20.9346 14.4717 19.4316 12.5293 16.9531 11.6152L16.6631 7.52832C17.9727 6.78125 19.0098 5.96387 19.4668 5.38379C19.7041 5.06738 19.8271 4.75098 19.8271 4.46973C19.8271 3.88965 19.3789 3.45898 18.7197 3.45898H9.27148C8.6123 3.45898 8.16406 3.88965 8.16406 4.46973C8.16406 4.75098 8.28711 5.06738 8.52441 5.38379C8.98145 5.96387 10.0186 6.78125 11.3281 7.52832L11.0469 11.6152C8.55957 12.5293 7.05664 14.4717 7.05664 16.3613Z" fill="#ff2654"/>
</svg>
</div>
<div class="player-pin" title="Unpin to Top" v-if="app.cfg.visual.miniplayer_top_toggle === true" @click="app.pinMiniPlayer(false)">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" fill="none" class="feather feather-pin-slashed">
<path d="M9.271 3.459c-.659 0-1.107.43-1.107 1.01 0 .282.114.59.352.897.448.59 1.494 1.415 2.777 2.162l-.07 1.02 8.99 8.991c.458-.202.722-.615.722-1.178 0-1.89-1.503-3.832-3.947-4.746l-.29-4.087c1.275-.747 2.312-1.555 2.76-2.144.246-.308.37-.633.37-.914 0-.58-.45-1.011-1.108-1.011H9.27ZM5.15 6.061l16.076 16.057c.272.281.73.273.993 0a.703.703 0 0 0 0-.984L6.15 5.076a.716.716 0 0 0-1.002 0 .711.711 0 0 0 0 .985Zm1.908 10.3c0 .791.536 1.319 1.37 1.319h4.703v4.157c0 1.24.624 2.487.861 2.487.246 0 .87-1.248.87-2.487V17.81h.413l-5.537-5.545c-1.678 1.002-2.68 2.557-2.68 4.095Z" fill="#ff2654"/>
</svg>
</div>
<div class="player-exit" title="Close" @click="app.miniPlayer(false)">
<svg fill="#323232e3" width="21" height="21" viewBox="0 0 21 21" aria-role="presentation" focusable="false" xmlns="http://www.w3.org/2000/svg">