2022-02-24 22:29:34 +00:00
< template >
< div >
2022-03-14 00:41:03 +00:00
< video controls autoplay :src ="vidSrc" width = "100%" height = "300vh" / >
2022-03-20 00:27:45 +00:00
< v -card class = "ml-2 mr-2 flat light" flat >
2022-03-20 07:24:38 +00:00
< v -card -title style = "padding-top: 0" > { { title } } < / v - c a r d - t i t l e >
2022-03-20 00:27:45 +00:00
< v -card -text >
2022-03-20 07:24:38 +00:00
< span > { { views } } views • { { uploaded } } < / s p a n
> < br / >
2022-03-20 00:27:45 +00:00
<!-- Scrolling Div For Interactions -- - >
2022-03-20 07:24:38 +00:00
< div style = "display: flex" >
2022-03-20 00:27:45 +00:00
< v -list -item v-for ="(item, index) in interactions" :key ="index" >
2022-03-20 07:24:38 +00:00
< button
class = "vertical-button"
style = "padding: 0; margin: 0"
elevation = "0"
: disabled = "item.disabled"
>
2022-03-20 00:27:45 +00:00
< v -icon v -text = " item.icon " / >
< div v -text = " item.value | | item.name " / >
< / button >
< / v - l i s t - i t e m >
< / div >
<!-- End Scrolling Div For Interactions -- - >
< / v - c a r d - t e x t >
2022-03-19 06:18:07 +00:00
< p > { { description } } < / p >
< / v - c a r d >
2022-03-20 00:27:45 +00:00
< recommended / >
2022-02-24 22:29:34 +00:00
< / div >
< / template >
2022-03-20 00:27:45 +00:00
< style >
. vertical - button span . v - btn _ _content {
flex - direction : column ;
justify - content : space - around ;
}
< / style >
2022-02-24 22:29:34 +00:00
< script >
2022-03-20 07:24:38 +00:00
import recommended from "../components/recommended.vue" ;
2022-02-24 22:29:34 +00:00
export default {
2022-03-20 00:27:45 +00:00
components : { recommended } ,
2022-02-24 22:29:34 +00:00
data ( ) {
return {
2022-03-20 00:27:45 +00:00
interactions : [
2022-03-20 07:24:38 +00:00
{
name : "Likes" ,
icon : "mdi-thumb-up" ,
action : null ,
value : this . likes ,
disabled : true ,
} ,
{
name : "Dislikes" ,
icon : "mdi-thumb-down" ,
action : null ,
value : this . dislikes ,
disabled : true ,
} ,
2022-03-20 00:27:45 +00:00
{ name : "Share" , icon : "mdi-share" , action : null , disabled : true } ,
] ,
title : null ,
likes : 100 ,
dislikes : null ,
uploaded : null ,
vidSrc : null ,
description : null ,
views : null ,
2022-03-20 07:24:38 +00:00
} ;
2022-03-13 23:21:41 +00:00
} ,
mounted ( ) {
2022-03-20 07:24:38 +00:00
this . likes = 100 ;
this . $youtube . getVid ( this . $route . query . v ) . then ( ( result ) => {
console . log ( "Video info data" , result ) ;
console . log ( result . availableResolutions ) ;
this . vidSrc = result . availableResolutions [ 1 ] . url ;
this . title = result . title ;
this . description = result . metadata . description ; // While this works, I do recommend using the rendered description instead in the future as there are some things a pure string wouldn't work with
this . views = result . metadata . viewCount . toLocaleString ( ) ;
this . likes = result . metadata . likes . toLocaleString ( ) ;
this . uploaded = result . metadata . uploadDate ;
this . interactions [ 0 ] . value = result . metadata . likes ;
2022-03-19 06:18:07 +00:00
} ) ;
this . $youtube . getReturnYoutubeDislike ( this . $route . query . v , ( data ) => {
2022-03-20 00:10:18 +00:00
this . dislikes = data . dislikes . toLocaleString ( ) ;
2022-03-20 00:43:55 +00:00
this . interactions [ 1 ] . value = data . dislikes . toLocaleString ( ) ;
2022-03-19 06:18:07 +00:00
} ) ;
2022-03-20 07:24:38 +00:00
} ,
} ;
2022-02-24 22:29:34 +00:00
< / script >