diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index dbd093e..cd4a568 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "hazetv-alfatube-1", - "version": "0.1.0", + "version": "0.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -5879,13 +5879,11 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true, - "optional": true + "bundled": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5898,18 +5896,15 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "concat-map": { "version": "0.0.1", - "bundled": true, - "optional": true + "bundled": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "core-util-is": { "version": "1.0.2", @@ -6012,8 +6007,7 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, - "optional": true + "bundled": true }, "ini": { "version": "1.3.5", @@ -6023,7 +6017,6 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -6036,20 +6029,17 @@ "minimatch": { "version": "3.0.4", "bundled": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true, - "optional": true + "bundled": true }, "minipass": { "version": "2.2.4", "bundled": true, - "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -6066,7 +6056,6 @@ "mkdirp": { "version": "0.5.1", "bundled": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -6139,8 +6128,7 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, - "optional": true + "bundled": true }, "object-assign": { "version": "4.1.1", @@ -6150,7 +6138,6 @@ "once": { "version": "1.4.0", "bundled": true, - "optional": true, "requires": { "wrappy": "1" } @@ -6256,7 +6243,6 @@ "string-width": { "version": "1.0.2", "bundled": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", diff --git a/package.json b/package.json index 11de2af..83a340d 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "browserslist": [ ">0.2%", "not dead", - "not ie <= 11", + "not ie <= 8", "not op_mini all" ] } diff --git a/src/TopBar.js b/src/TopBar.js index 4705dae..e85f4f1 100644 --- a/src/TopBar.js +++ b/src/TopBar.js @@ -22,7 +22,7 @@ class TopBar extends Component { } handleSubmit = event => { event.preventDefault(); - event.target.reset(); + // event.target.reset(); this.props.history.push('/search/' + this.state.query); } render() { @@ -87,7 +87,7 @@ class TopBar extends Component { className="mr-sm-2" onChange={this.handleChange} /> - + diff --git a/src/VideoInfo.js b/src/VideoInfo.js index c629a1d..fcb9159 100644 --- a/src/VideoInfo.js +++ b/src/VideoInfo.js @@ -53,8 +53,8 @@ class VideoInfo extends React.Component { }), error => { console.error(error); this.setState({ - isLoaded: true, - error + error, + isLoaded: true }); }); } @@ -64,10 +64,11 @@ class VideoInfo extends React.Component { const momentDuration = this.momentDuration; const ISO_8601parse = this.ISO_8601parse; if (error) { + let htmlRegEx = /<\/?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[\^'">\s]+))?)+\s*|\s*)\/?>/gm; return ( {} - Error: {error.message} -- Cannot get {error.config.url} + Error: {error.message} -- {error.response.data && error.response.data.error.message.replace(htmlRegEx,'')} ); } else if (!isLoaded) { diff --git a/src/VideoList.js b/src/VideoList.js index 7126b56..6141423 100644 --- a/src/VideoList.js +++ b/src/VideoList.js @@ -114,7 +114,7 @@ class VideoList extends React.Component { ); } else if (!isLoaded) { return -
+
; } else { return ( diff --git a/src/VideoPlayer.js b/src/VideoPlayer.js index 9c2b65b..99520f6 100644 --- a/src/VideoPlayer.js +++ b/src/VideoPlayer.js @@ -15,8 +15,8 @@ class VideoPlayer extends React.Component { modestbranding: 1, fs: 0, iv_load_policy:3, - rel: 0, - origin//: 'http://site1854.tw.cs.unibo.it' + rel: 0 + //origin//: 'http://site1854.tw.cs.unibo.it' } }, promise1: null, @@ -42,7 +42,7 @@ class VideoPlayer extends React.Component { // access to player in all event handlers via event.target _onError(event) { - console.error('Player error: ', event); + this.setState({error:event.data}); } _onPlay(event) {} diff --git a/src/index.js b/src/index.js index fe69aae..4c72e38 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,7 @@ +import 'react-app-polyfill/ie9'; //import 'bootstrap/dist/css/bootstrap.css'; // import './css/bootswatch/darkly/bootstrap.min.css' import './css/bootswatch/superhero/bootstrap.min.css' -import 'react-app-polyfill/ie9'; //import '@babel/polyfill'; import React from 'react'; import ReactDOM from 'react-dom'; diff --git a/src/reccomenders/Recent.js b/src/reccomenders/Recent.js index 81ede07..d4e9aa0 100644 --- a/src/reccomenders/Recent.js +++ b/src/reccomenders/Recent.js @@ -30,6 +30,12 @@ class Recent extends React.Component { // //this.shuffleArray(response.data); // console.info ('a',response.data); this.getThumbnailsNames(JSON.parse(localStorage.getItem('lastWatched'))); + + let lastWatchedList = JSON.parse(localStorage.getItem('lastWatched')).map(x =>x.lastWatched) + let now = moment(new Date()); // riferimento unico temporale + let timePast = lastWatchedList.map(item => now.diff(item)) // differenza in secondi tra adesso e lastWatched + console.info(lastWatchedList, timePast.sort((a, b) => a - b)) + // console.info(response.data.recommended); // // this.setState({ // // isLoaded: true, @@ -105,14 +111,14 @@ class Recent extends React.Component { ); } else if (!isLoaded) { return -
+
; } else { return ( {items.map(item => ( - - + + -
+
); } else { - return ( - // - // {items.map(item=>( - // - // - // - // - // - // {item.name}
- // {item.lastSelected} - //
- //
- // - //
- // ))} - //
+ if(window.innerWidth < 992){ + return( + + {items.map(item=>( + + + + + +

{item.name}

+

{item.lastSelected}

+

Reccomender: fvitali

+
+
+ +
+ ))} +
+ ); + }else{ + return(
    { items.map(item => ( @@ -129,7 +134,7 @@ class fvitali extends React.Component { )) }
- ); + );} } } }