Skip to content

Commit

Permalink
preventing touch listener from being reapplied by moving it out of lo… (
Browse files Browse the repository at this point in the history
MailOnline#15)

* preventing touch listener from being reapplied by moving it out of loadstart listener

* fixed typo
  • Loading branch information
CJAllen056 authored and iq-dot committed May 3, 2017
1 parent 38c1b8c commit dc64916
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -454,22 +454,21 @@ class App extends React.Component {

player.muted(true);

this.player.on('loadstart', () => {
player.tech({ IWillNotUseThisInPlugins: true }).on('touchend', (e) => {
// only handle touch when it was tapped on the video
if (e.srcElement.tagName.toLowerCase() === 'video') {
player.paused() ? player.play() : player.pause();
}
});

player.on('loadstart', () => {
const playlist = player.playlist();
const currentItem = player.playlist.currentItem();
const title = playlist[currentItem < 0 ? 0 : currentItem].title;

player.controlBar.volumeMenuButton.show();
player.on('touchend', (e) => {
// only handle touch when it was tapped on the video
if (e.srcElement.tagName.toLowerCase() === 'video') {
player.paused() ? player.play() : player.pause();
}
});

if (CLIENT === 'telegraph') {
player.addClass('telegraph-player');
}
if (CLIENT === 'telegraph') player.addClass('telegraph-player');

this.overlay(title);
});
Expand Down

0 comments on commit dc64916

Please sign in to comment.