minor fixes

This commit is contained in:
matteo
2018-12-03 01:22:48 +01:00
parent 0f38bae769
commit 5f093c35d6
3 changed files with 55 additions and 82 deletions
+18 -11
View File
@@ -36,7 +36,7 @@ class VideoList extends React.Component {
);
}
// METODI
// METODI
getThumbnails(videoItems) {
let idToLookFor = videoItems.map(item => item.videoID);
let finalChunk = (videoItems.length % 50) + 100;
@@ -125,29 +125,36 @@ class VideoList extends React.Component {
{items.map(item => (
<Col key={item.videoID} lg={{ span: 3 }} md="6">
<Card className="my-1 carta">
<Link to={{
pathname: '/video/' + item.videoID,
state: {
artist: item.artist,
title: item.title +' '+ item.artist
<Link
to={{
pathname: '/video/' + item.videoID,
state: {
artist: item.artist,
title: item.title
}
}}>
}}
>
{/* {item.artist} - {item.title} {item.videoID} {item.category} */}
<Card.Img src={item.thumbnail} alt={'Thumbnail of '+item.title } />
<Card.Img
src={item.thumbnail}
alt={'Thumbnail of ' + item.title}
/>
<Card.ImgOverlay>
<Card.Title className="bg-dark d-inline text-white">
{item.artist} - {item.title}
</Card.Title>
<p className='d-table d-lg-none card-text bg-dark text-white'>{item.category}</p>
<p className="d-table d-lg-none card-text bg-dark text-white">
{item.category}
</p>
</Card.ImgOverlay>
</Link>
</Card>
</Col>
))}
))}
</React.Fragment>
);
}
}
}
export default VideoList;
export default VideoList;
+7 -9
View File
@@ -64,16 +64,15 @@ class VideoPlayer extends Component {
</React.Fragment>
);
}
// access to player in all event handlers via event.target
_onError(event) {
console.error('on error', event);
console.error('Error: ', event);
}
_onPlay(event) {}
_onReady(event) {
// access to player in all event handlers via event.target
}
_onReady(event) {}
_onStateChange(event) {
let timerId1, timerId2;
@@ -110,12 +109,11 @@ class VideoPlayer extends Component {
});
this.state.promise1
.then(
risultato => {
//console.info(risultato);
videoIdWatched => {
// post request to local db
axios
.post('http://localhost:8000/test', {
id: risultato.toString()
.post('http://localhost:8000/videotrack', {
id: videoIdWatched.toString()
})
.then(
response => console.info(response.data),