summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2018-08-09 03:32:55 +0900
committerGitHub <noreply@github.com>2018-08-09 03:32:55 +0900
commit196c55edbc584c280f72db15180b18c4e8ba6fa6 (patch)
tree32cd19f2eac5e80636607453acba40cf078ea117 /src
parentfix(package): update style-loader to version 0.22.1 (diff)
parentUpdate url-preview.vue (diff)
downloadmisskey-196c55edbc584c280f72db15180b18c4e8ba6fa6.tar.gz
misskey-196c55edbc584c280f72db15180b18c4e8ba6fa6.tar.bz2
misskey-196c55edbc584c280f72db15180b18c4e8ba6fa6.zip
Merge pull request #2125 from acid-chicken/acid-chicken-patch-2
Spotify
Diffstat (limited to 'src')
-rw-r--r--src/client/app/common/views/components/url-preview.vue5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/client/app/common/views/components/url-preview.vue b/src/client/app/common/views/components/url-preview.vue
index 1e625f69ed..2c265a9a71 100644
--- a/src/client/app/common/views/components/url-preview.vue
+++ b/src/client/app/common/views/components/url-preview.vue
@@ -2,6 +2,9 @@
<iframe v-if="youtubeId" type="text/html" height="250"
:src="`https://www.youtube.com/embed/${youtubeId}?origin=${misskeyUrl}`"
frameborder="0"/>
+<iframe v-else-if="spotifyId"
+ :src="`https://open.spotify.com/embed/track/${spotifyId}`"
+ frameborder="0" allowtransparency="true" allow="encrypted-media" />
<div v-else-if="tweetUrl && detail" class="twitter">
<blockquote ref="tweet" class="twitter-tweet" :data-theme="$store.state.device.darkmode ? 'dark' : null">
<a :href="url"></a>
@@ -60,6 +63,8 @@ export default Vue.extend({
this.youtubeId = url.searchParams.get('v');
} else if (url.hostname == 'youtu.be') {
this.youtubeId = url.pathname;
+ } else if (url.hostname == 'open.spotify.com') {
+ this.spotifyId = url.pathname.split('/').reverse().filter(x => x !== '')[0];
} else if (this.detail && url.hostname == 'twitter.com' && /^\/.+\/status(es)?\/\d+/.test(url.pathname)) {
this.tweetUrl = url;
const twttr = (window as any).twttr || {};