Skip to content

Commit

Permalink
fix(FEC-8714): 'onclick' handler for iOS is not needed (#181)
Browse files Browse the repository at this point in the history
we moved the creation of the video element to the autoplay check, which resolved this issue. so this click handler isn't needed anymore.
  • Loading branch information
odedhutzler committed Dec 2, 2018
1 parent 9e76b78 commit 10b3c42
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
23 changes: 1 addition & 22 deletions src/common/utils/setup-helpers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @flow
import {setDefaultAnalyticsPlugin} from 'player-defaults';
import {Env, TextStyle, Utils, setCapabilities, EngineType} from '@playkit-js/playkit-js';
import {Env, TextStyle, Utils} from '@playkit-js/playkit-js';
import {ValidationErrorType} from './validation-error';
import StorageManager from '../storage/storage-manager';
import type {LogLevelObject} from './logger';
Expand Down Expand Up @@ -127,26 +127,6 @@ function setStorageTextStyle(player: KalturaPlayer): void {
}
}

/**
* Call to setCapabilities on the first UI_CLICKED event
* @private
* @param {Player} player - The Kaltura player.
* @returns {void}
*/
function attachToFirstClick(player: Player): void {
if (isIos()) {
const onUIClicked = () => {
player.removeEventListener(player.Event.UI.UI_CLICKED, onUIClicked);
setCapabilities(EngineType.HTML5, {autoplay: true});
};
const onSourceSelected = () => {
player.removeEventListener(player.Event.SOURCE_SELECTED, onSourceSelected);
player.addEventListener(player.Event.UI.UI_CLICKED, onUIClicked);
};
player.addEventListener(player.Event.SOURCE_SELECTED, onSourceSelected);
}
}
/**
* check the player debug mode according to config or URL query string params
* @private
Expand Down Expand Up @@ -392,7 +372,6 @@ export {
applyStorageSupport,
applyCastSupport,
setStorageTextStyle,
attachToFirstClick,
validateConfig,
setLogLevel,
createKalturaPlayerContainer,
Expand Down
2 changes: 0 additions & 2 deletions src/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {evaluatePluginsConfig} from './common/plugins/plugins-config';
import {
applyCastSupport,
applyStorageSupport,
attachToFirstClick,
getDefaultOptions,
printSetupMessages,
setLogLevel,
Expand Down Expand Up @@ -33,7 +32,6 @@ function setup(options: PartialKPOptionsObject | LegacyPartialKPOptionsObject):
setStorageTextStyle(player);
applyStorageSupport(player);
applyCastSupport(defaultOptions, player);
attachToFirstClick(player);
return player;
}

Expand Down

0 comments on commit 10b3c42

Please sign in to comment.