bugfix and andrey fix and better docs

This commit is contained in:
Anthony 2021-08-09 20:14:45 +02:00
parent e70803814d
commit a64f513eee
No known key found for this signature in database
GPG key ID: C386D3C93D50E356

View file

@ -77,8 +77,8 @@ if (window.localStorage.getItem(SHARE_INTERNAL) === 'true') internalAnalyticsEna
// @endif // @endif
/** /**
* Determine the mobile operating system. * Determine the mobile device type viewing the data
* This function returns one of 'iOS', 'Android', 'Windows Phone', or 'unknown'. * This function returns one of 'and' (Android), 'ios', or 'web'.
* *
* @returns {String} * @returns {String}
*/ */
@ -120,7 +120,7 @@ async function sendAndResetWatchmanData() {
const objectToSend = { const objectToSend = {
rebuf_count: amountOfBufferEvents, rebuf_count: amountOfBufferEvents,
rebuf_duration: amountOfBufferTimeInMS, rebuf_duration: amountOfBufferTimeInMS,
url: claimUrl, url: claimUrl.replace('lbry://', ''),
device: getDeviceType(), device: getDeviceType(),
duration: Math.round(durationInSeconds) * 1000, duration: Math.round(durationInSeconds) * 1000,
protocol, protocol,
@ -182,12 +182,10 @@ const analytics: Analytics = {
// TODO: clear data here // TODO: clear data here
}, },
videoIsPlaying: (isPlaying, passedPlayer) => { videoIsPlaying: (isPlaying, passedPlayer) => {
var playerToUse = videoPlayer || passedPlayer;
// have to use this because videojs pauses/unpauses during seek // have to use this because videojs pauses/unpauses during seek
// sometimes the seeking function isn't populated yet so check for it as well // sometimes the seeking function isn't populated yet so check for it as well
if(playerToUse && playerToUse.seeking){ if (passedPlayer && passedPlayer.seeking) {
var playerIsSeeking = playerToUse.seeking(); var playerIsSeeking = passedPlayer.seeking();
} }
// if player isn't seeking it's not a seeking caused start or pause // if player isn't seeking it's not a seeking caused start or pause