summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2018-08-09 04:07:33 +0900
committerGitHub <noreply@github.com>2018-08-09 04:07:33 +0900
commit56b69b5fb77646b734cbdad5ead97421c89d2c5e (patch)
tree1eeaca3f69ef3dac8faf61940bf5f879f7040b67 /src
parentMerge pull request #2125 from acid-chicken/acid-chicken-patch-2 (diff)
parentUpdate url-preview.vue (diff)
downloadmisskey-56b69b5fb77646b734cbdad5ead97421c89d2c5e.tar.gz
misskey-56b69b5fb77646b734cbdad5ead97421c89d2c5e.tar.bz2
misskey-56b69b5fb77646b734cbdad5ead97421c89d2c5e.zip
Merge pull request #2126 from acid-chicken/acid-chicken-patch-2
ニコニコ動画
Diffstat (limited to 'src')
-rw-r--r--src/client/app/common/views/components/url-preview.vue9
1 files changed, 9 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 2c265a9a71..a61e9fd817 100644
--- a/src/client/app/common/views/components/url-preview.vue
+++ b/src/client/app/common/views/components/url-preview.vue
@@ -5,6 +5,9 @@
<iframe v-else-if="spotifyId"
:src="`https://open.spotify.com/embed/track/${spotifyId}`"
frameborder="0" allowtransparency="true" allow="encrypted-media" />
+<iframe v-else-if="nicovideoId"
+ :src="`https://embed.nicovideo.jp/watch/${nicovideoId}?oldScript=1&referer=${misskeyUrl}&from=${position || '0'}&allowProgrammaticFullScreen=1`"
+ frameborder="0" allow="autoplay; encrypted-media" allowfullscreen />
<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>
@@ -52,6 +55,9 @@ export default Vue.extend({
icon: null,
sitename: null,
youtubeId: null,
+ spotifyId: null,
+ nicovideoId: null,
+ position: null,
tweetUrl: null,
misskeyUrl
};
@@ -65,6 +71,9 @@ export default Vue.extend({
this.youtubeId = url.pathname;
} else if (url.hostname == 'open.spotify.com') {
this.spotifyId = url.pathname.split('/').reverse().filter(x => x !== '')[0];
+ } else if (['nicovideo.jp', 'www.nicovideo.jp', 'nico.ms'].includes(url.hostname)) {
+ this.nicovideoId = url.pathname.split('/').reverse().filter(x => x !== '')[0];
+ this.position = url.searchParams.get('from');
} else if (this.detail && url.hostname == 'twitter.com' && /^\/.+\/status(es)?\/\d+/.test(url.pathname)) {
this.tweetUrl = url;
const twttr = (window as any).twttr || {};