Archived
Merge branch 'playeronside' of https://bitbucket.org/sco44/tecnologiabanana into playeronside
This commit is contained in:
Generated
+5
@@ -15293,6 +15293,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"youtube-page-token": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/youtube-page-token/-/youtube-page-token-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-z4bGGXnv5OH/O7FGlHWObyPnM0vlJyiq5r2pwJShBwsAjUUz+qx/Q3Up4F5bthmjU1Ov4U4EpJl1tSE2DIKh/A=="
|
||||||
|
},
|
||||||
"youtube-player": {
|
"youtube-player": {
|
||||||
"version": "5.5.1",
|
"version": "5.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/youtube-player/-/youtube-player-5.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/youtube-player/-/youtube-player-5.5.1.tgz",
|
||||||
|
|||||||
+2
-1
@@ -20,7 +20,8 @@
|
|||||||
"react-router-dom": "^4.3.1",
|
"react-router-dom": "^4.3.1",
|
||||||
"react-scripts": "2.1.1",
|
"react-scripts": "2.1.1",
|
||||||
"react-youtube": "^7.8.0",
|
"react-youtube": "^7.8.0",
|
||||||
"wikijs": "^4.8.1"
|
"wikijs": "^4.8.1",
|
||||||
|
"youtube-page-token": "^1.0.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "react-scripts start",
|
"start": "react-scripts start",
|
||||||
|
|||||||
@@ -9,7 +9,12 @@ import VideoList from './VideoList';
|
|||||||
import Suggestion from './areainfo/Suggestion';
|
import Suggestion from './areainfo/Suggestion';
|
||||||
import { ReactHeight } from 'react-height';
|
import { ReactHeight } from 'react-height';
|
||||||
import './css/App.css';
|
import './css/App.css';
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
|
=======
|
||||||
|
import Related from './reccomenders/Related';
|
||||||
|
import Random from './reccomenders/Random';
|
||||||
|
>>>>>>> d34f049d7f8903074356e8a32a57c34891df385e
|
||||||
|
|
||||||
class App extends React.Component {
|
class App extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
|||||||
+27
-25
@@ -1,9 +1,9 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import './App.css';
|
|
||||||
import 'bootstrap/dist/css/bootstrap.css';
|
import 'bootstrap/dist/css/bootstrap.css';
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import createpageToken from 'youtube-page-token';
|
import createpageToken from 'youtube-page-token';
|
||||||
import YouTube from "react-youtube";
|
import {Card} from "react-bootstrap";
|
||||||
|
import {Link} from "react-router-dom";
|
||||||
|
|
||||||
class RecommenderRandom extends Component{
|
class RecommenderRandom extends Component{
|
||||||
constructor(props){
|
constructor(props){
|
||||||
@@ -24,7 +24,7 @@ class RecommenderRandom extends Component{
|
|||||||
'part': 'snippet',
|
'part': 'snippet',
|
||||||
'topicId' : '/m/04rlf', //Filtro per la musica.In questo caso il valore è quello della parent directory
|
'topicId' : '/m/04rlf', //Filtro per la musica.In questo caso il valore è quello della parent directory
|
||||||
'type' : 'video', //che contiene tutti i generi di musica
|
'type' : 'video', //che contiene tutti i generi di musica
|
||||||
'maxResults': '20',
|
'maxResults': '21',
|
||||||
'pageToken' : pageToken,
|
'pageToken' : pageToken,
|
||||||
'key': 'AIzaSyA21Odw9UdfiOJnxvA_eDfOW0OxuUfHKig'
|
'key': 'AIzaSyA21Odw9UdfiOJnxvA_eDfOW0OxuUfHKig'
|
||||||
}
|
}
|
||||||
@@ -41,31 +41,33 @@ class RecommenderRandom extends Component{
|
|||||||
}
|
}
|
||||||
|
|
||||||
render(){
|
render(){
|
||||||
const opts = {
|
|
||||||
height: '250',
|
|
||||||
width: '250',
|
|
||||||
playerVars: {
|
|
||||||
autoplay: 0
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return (
|
return (
|
||||||
<div style={{overflow: 'auto',overflowY : 'scroll'}}>
|
<div style={{width: '100rem',height:'100rem'}}>
|
||||||
{this.state.items.map(function (item,index) {
|
{this.state.items.map(function (item,index) {
|
||||||
return(
|
return(
|
||||||
<div key={index} style={{margin: '1rem',float: 'left',clear : 'left'}}>
|
<div key={index} style={{margin: '1rem',float: 'left'}}>
|
||||||
<YouTube
|
<Card>
|
||||||
videoId={item.id.videoId}
|
<Link
|
||||||
opts={opts}
|
to={{
|
||||||
/>
|
pathname: '/video/' + item.id.videoId,
|
||||||
<div style={{marginLeft : '10rem',float : 'right',maxWidth:'40rem'}}>
|
}}
|
||||||
<h3>{item.snippet.title}</h3>
|
>
|
||||||
<h4>{item.snippet.channelTitle} - {item.snippet.publishedAt.replace(/(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+).000Z/,function(match,p1,p2,p3,p4,p5,p6){
|
<Card.Img
|
||||||
return(p3+'/'+p2+'/'+p1+' at '+p4+':'+p5+':'+p6); //Funzione che trasforma la data e ora di pubblicazione dal formato ISO nel normale formato da cristiani
|
src={item.snippet.thumbnails.high.url}
|
||||||
})}
|
alt={'Thumbnail of ' + item.title}
|
||||||
</h4>
|
style={{width:'30rem',height:'20rem'}}
|
||||||
<p style={{fontSize: 'large'}}>{item.snippet.description}<br/>~Recommended as a Random Video~</p>
|
/>
|
||||||
</div>
|
<Card.ImgOverlay>
|
||||||
</div>
|
<Card.Title className="bg-dark d-inline text-white">
|
||||||
|
{item.snippet.title}<br/>
|
||||||
|
{item.snippet.channelTitle} - {item.snippet.publishedAt.replace(/(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+).000Z/,function(match,p1,p2,p3,p4,p5,p6){
|
||||||
|
return(p3+'/'+p2+'/'+p1+' at '+p4+':'+p5+':'+p6); //Funzione che trasforma la data e ora di pubblicazione dal formato ISO nel normale formato da cristiani
|
||||||
|
})}
|
||||||
|
</Card.Title>
|
||||||
|
</Card.ImgOverlay>
|
||||||
|
</Link>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user