diff --git a/resources/cider-ui-tests/index.html b/resources/cider-ui-tests/index.html
index 685a752f..8b32d746 100644
--- a/resources/cider-ui-tests/index.html
+++ b/resources/cider-ui-tests/index.html
@@ -2,6 +2,15 @@
+
-
-
-
-
Song Name
-
Artist - Album
-
-
+
+
+
+
+
+ {{ mk.nowPlayingItem["attributes"]["name"] }}
+
+
+ {{ mk.nowPlayingItem["attributes"]["artistName"] }} - {{ mk.nowPlayingItem["attributes"]["albumName"] }}
+
+
+
+
+
❤️
- ❤️
-
+
+
+
+
+
+ currentPlaybackProgress: {{ app.mk.currentPlaybackProgress }}
+
+ currentPlaybackDuration: {{ app.mk.currentPlaybackDuration }}
+
+
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, urna eu tincidunt
@@ -151,6 +180,7 @@
+
diff --git a/resources/cider-ui-tests/index.js b/resources/cider-ui-tests/index.js
index 564c6bda..4b2870f2 100644
--- a/resources/cider-ui-tests/index.js
+++ b/resources/cider-ui-tests/index.js
@@ -1,9 +1,50 @@
var app = new Vue({
el: "#app",
data: {
- drawertest: false
+ drawertest: false,
+ mk: {},
+ quickPlayQuery: ""
},
methods: {
-
+ init() {
+ this.mk = MusicKit.getInstance()
+ this.$forceUpdate()
+ },
+ mkReady() {
+ if(this.mk["nowPlayingItem"]) {
+ return true
+ }else{
+ return false
+ }
+ },
+ getNowPlayingArtwork(size = 600) {
+ if (this.mk["nowPlayingItem"]["attributes"]["artwork"]["url"]) {
+ return `url("${this.mk["nowPlayingItem"]["attributes"]["artwork"]["url"].replace('{w}', size).replace('{h}', size)}")`;
+ } else {
+ return "";
+ }
+ },
+ quickPlay(query) {
+ let self = this
+ MusicKit.getInstance().api.search(query, { limit: 2, types: 'songs' }).then(function (data) {
+ MusicKit.getInstance().setQueue({ song: data["songs"]['data'][0]["id"] }).then(function (queue) {
+ MusicKit.getInstance().play()
+ setTimeout(()=>{
+ self.$forceUpdate()
+ }, 1000)
+ })
+ })
+ }
}
-})
\ No newline at end of file
+})
+
+document.addEventListener('musickitloaded', function() {
+ // MusicKit global is now defined
+ MusicKit.configure({
+ developerToken: '',
+ app: {
+ name: 'My Cool Web App',
+ build: '1978.4.1'
+ }
+ });
+});
\ No newline at end of file
diff --git a/resources/cider-ui-tests/style.css b/resources/cider-ui-tests/style.css
index e7db7d70..7d764a91 100644
--- a/resources/cider-ui-tests/style.css
+++ b/resources/cider-ui-tests/style.css
@@ -538,7 +538,7 @@ input[type=range].web-slider::-webkit-slider-runnable-track {
.app-chrome .app-chrome-item>.app-playback-controls .artwork {
width: 42px;
height: 42px;
- background-image: url("artwork.jpeg");
+ background-image: var(--artwork);
background-position: center;
background-size: contain;
background-repeat: no-repeat;
diff --git a/resources/functions/cider-win.js b/resources/functions/cider-win.js
index 5bbd703e..932681e4 100644
--- a/resources/functions/cider-win.js
+++ b/resources/functions/cider-win.js
@@ -13,10 +13,14 @@ const CiderWin = {
vibrancy: 'dark',
hasShadow: false,
webPreferences: {
+ plugins: true,
nodeIntegration: true,
- webSecurity: false,
+ nodeIntegrationInWorker: false,
+ webSecurity: true,
allowRunningInsecureContent: true,
enableRemoteModule: true,
+ sandbox: true,
+ nativeWindowOpen: true
}
}
if (process.platform === "darwin" || process.platform === "linux") {