diff options
| author | Acid Chicken (硫酸鶏) <root@acid-chicken.com> | 2018-08-09 04:05:28 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-09 04:05:28 +0900 |
| commit | ebf0479ecc11d3eada4453772a1ebdc0063e00af (patch) | |
| tree | 1eeaca3f69ef3dac8faf61940bf5f879f7040b67 /src | |
| parent | Merge pull request #2125 from acid-chicken/acid-chicken-patch-2 (diff) | |
| download | misskey-ebf0479ecc11d3eada4453772a1ebdc0063e00af.tar.gz misskey-ebf0479ecc11d3eada4453772a1ebdc0063e00af.tar.bz2 misskey-ebf0479ecc11d3eada4453772a1ebdc0063e00af.zip | |
Update url-preview.vue
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/app/common/views/components/url-preview.vue | 9 |
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 || {}; |