commit prepotente

This commit is contained in:
matteo
2019-02-12 16:55:46 +01:00
parent ccde79f4c4
commit b24efcc18b
5 changed files with 67 additions and 39 deletions
+12 -7
View File
@@ -7,12 +7,15 @@ import { withRouter } from 'react-router-dom';
class VideoPlayer extends React.Component {
state = {
opt: {
height: '390',
width: '640',
// height: '390',
// width: '640',
playerVars: {
// https://developers.google.com/youtube/player_parameters
autoplay: 0,
modestbranding: 1
modestbranding: 1,
fs: 0,
iv_load_policy:3,
rel: 0
}
},
promise1: null,
@@ -91,10 +94,12 @@ class VideoPlayer extends React.Component {
error => console.info(error, videoIdWatched.toString())
);
// local storage logic for recent reccomender
// let temp=localStorage.getItem('lastWatched');
// temp.push({id: videoIdWatched.toString(), date: new Date})
let tmp = JSON.parse(localStorage.getItem('lastWatched'))
tmp.push({
'id': videoIdWatched.toString(),
'date' : new Date()
});
localStorage.setItem('lastWatched', JSON.stringify(tmp));
//.finally(()=>{})
clearInterval(timerId1);
},