@ioiotv/io-react
Advanced tools
Comparing version 1.0.4 to 1.1.0
{ | ||
"name": "@ioiotv/io-react", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"description": "Player for ioio.tv services", | ||
@@ -9,3 +9,3 @@ "keywords": [], | ||
"ask-for-promise": "1.3.1", | ||
"axios": "0.26.0", | ||
"axios": "0.26.1", | ||
"react": "17.0.2", | ||
@@ -12,0 +12,0 @@ "react-dom": "17.0.2", |
@@ -109,2 +109,3 @@ import { findDOMNode } from "react-dom" | ||
window.a = this | ||
this.writeIntoStatistics = ioServices.writeIntoStatistics | ||
this.loadChannelsSchedules () | ||
@@ -398,3 +399,3 @@ this.setupRefreshSchedulesInterval () | ||
{ render } = this.state | ||
, setup = () => { | ||
, setup = channel => { | ||
if ( captionTrack ) captionTrack.mode = 'hidden' | ||
@@ -429,6 +430,6 @@ this.update ({ | ||
if ( vPlay && notPlaying ) vPlay.addEventListener ( 'playing', postponedSetup ) | ||
else setup () | ||
else setup ( channel ) | ||
return | ||
} | ||
setup () | ||
setup ( channel ) | ||
} // load func. | ||
@@ -435,0 +436,0 @@ |
import Axios from "axios" | ||
let axios; | ||
let | ||
axios | ||
, statistics = null | ||
, statURL = 'https://api-stats.dev.ioio.tv/collect/tmp_main' | ||
, org_id | ||
; | ||
const ioServices = { | ||
setup ( config ) { // setup connection to the server | ||
axios = Axios.create ({ | ||
axios = Axios.create ({ | ||
baseURL : config.baseUrl | ||
, timeout : config.timeout | ||
, headers : { accept: "application/json" } | ||
}) | ||
}) | ||
if ( config.org_id ) { | ||
org_id = config.org_id | ||
statistics = Axios.create ({ | ||
baseURL : statURL | ||
, timeout : config.timeout | ||
, headers : { accept: "application/json" } | ||
}) | ||
} | ||
} // setup func. | ||
, writeIntoStatistics ( data ) { | ||
if ( statistics == null ) { | ||
console.error (`Signal "${data.action}" is not send. Player's configuration needs a "org_id" field.`) | ||
return | ||
} | ||
statistics.put ( '/record', { | ||
Data : { | ||
org_id | ||
, c_guid : data.channel | ||
, action : data.action | ||
, current_time : data.timestamp | ||
} | ||
, PartitionKey : 'tmp_main' | ||
}) | ||
} | ||
, getChannels ( ) { | ||
@@ -17,0 +47,0 @@ return axios.get ( "/channels", { params: { active: 1 }} ) |
729586
2879
+ Addedaxios@0.26.1(transitive)
- Removedaxios@0.26.0(transitive)
Updatedaxios@0.26.1