Skip to content

Commit

Permalink
Version 2.2.6
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 998b6c72746adcf89de8d311c80c21ac70a65825
  • Loading branch information
Interfaced authored and l1bbcsg committed Aug 5, 2020
1 parent 4ebc7b4 commit dd74f08
Show file tree
Hide file tree
Showing 6 changed files with 825 additions and 778 deletions.
15 changes: 12 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
const currentYear = (new Date).getFullYear();
/*
* This file is part of the ZombieBox package.
*
* Copyright © 2014-2020, Interfaced
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

const currentYear = (new Date()).getFullYear();
const copyrightHeader = [
'',
' * This file is part of the ZombieBox package.',
Expand All @@ -20,7 +29,7 @@ module.exports = {
files: ['lib/**/*.js'],
extends: 'interfaced/esm',
settings: {
'import/resolver': 'zombiebox',
'import/resolver': 'zombiebox'
},
rules: {
'header/header': ['error', 'block', copyrightHeader]
Expand All @@ -32,7 +41,7 @@ module.exports = {
}
},
{
files: ['index.js', 'cli/**/*.js'],
files: ['.eslintrc.js', 'index.js', 'cli/**/*.js'],
extends: 'interfaced/node',
rules: {
'header/header': ['error', 'block', copyrightHeader]
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 2.2.6 (05.08.2020)
* Workaround for playing event not being fired after seeeking on webOS 1.4

## 2.2.5 (06.03.2020)
* Remove `Input.isPointingDeviceActive` override that forced mouse state to always be active

Expand Down
15 changes: 15 additions & 0 deletions lib/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,14 @@ export default class Input extends AbstractInput {
const activatePointing = this._setPointingStateActive.bind(this);
const deactivatePointing = this._setPointingStateInactive.bind(this);

const mouseMoveListener = () => {
activatePointing();
removeMouseMoveListener();
};
const removeMouseMoveListener = () => document.body.removeEventListener('mousemove', mouseMoveListener);

const cursorVisibilityChange = (event) => {
removeMouseMoveListener();
if (event && event.detail && event.detail.visibility) {
activatePointing();
} else {
Expand All @@ -103,5 +110,13 @@ export default class Input extends AbstractInput {
};

document.addEventListener('cursorStateChange', cursorVisibilityChange, false);

// When application is first started the platform may not be yet initialized to receive native events
// And therefore cant detect if mouse is already connected.
// Best we can do is catch its first movement and rely on native event from then on
document.body.addEventListener('mousemove', mouseMoveListener, this._isPassiveOptionSupported ? {
'passive': true,
'capture': false
} : false);
}
}
27 changes: 27 additions & 0 deletions lib/legacy-stateful-html5-video.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* file that was distributed with this source code.
*/
import {State} from 'zb/device/interfaces/i-stateful-video';
import {NativeReadyState} from 'zb/device/common/stateful-html5-video';
import StatefulHtml5Video from './stateful-html5-video';


Expand All @@ -18,9 +19,35 @@ export default class LegacyStatefulHtml5Video extends StatefulHtml5Video {
*/
_onNativePlaying() {
if (this._stateMachine.getCurrentState() === State.PLAYING) {
this._fireEvent(
this.EVENT_DEBUG_MESSAGE,
'legacy webos html5 skipped html5 play event'
);
return;
}

super._onNativePlaying();
}

/**
* @override
*/
_onNativeSeeked() {
const stateBefore = this._stateBeforeSeeking;

super._onNativeSeeked();

if (
this._videoElement.readyState >= NativeReadyState.HAVE_FUTURE_DATA &&
stateBefore === State.PLAYING &&
this._stateMachine.isIn(State.SEEKING)
) {
this._fireEvent(
this.EVENT_DEBUG_MESSAGE,
'legacy webos html5 jumped to PLAYING without waiting for play event'
);

this._stateMachine.setState(State.PLAYING);
}
}
}
Loading

0 comments on commit dd74f08

Please sign in to comment.