Skip to content

Commit

Permalink
chore: Reverted changes related to autoplay and iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
rafa8626 committed Oct 31, 2022
1 parent 6afbaf7 commit ad251da
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 88 deletions.
5 changes: 1 addition & 4 deletions dist/esm/controls/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
};
var _Play_player, _Play_button, _Play_events, _Play_controlPosition, _Play_controlLayer;
import Player from '../player';
import { EVENT_OPTIONS, IS_IOS } from '../utils/constants';
import { EVENT_OPTIONS } from '../utils/constants';
import { addEvent, isAudio } from '../utils/general';
class Play {
constructor(player, position, layer) {
Expand Down Expand Up @@ -47,9 +47,6 @@ class Play {
if (__classPrivateFieldGet(this, _Play_player, "f").getAd()) {
__classPrivateFieldGet(this, _Play_player, "f").getAd().playRequested = true;
}
if (IS_IOS && isAudio(__classPrivateFieldGet(this, _Play_player, "f").getElement()) && !__classPrivateFieldGet(this, _Play_player, "f").getElement().autoplay) {
__classPrivateFieldGet(this, _Play_player, "f").getElement().autoplay = true;
}
el.play();
__classPrivateFieldGet(this, _Play_events, "f").media.play();
}
Expand Down
54 changes: 28 additions & 26 deletions dist/openplayer.css

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions dist/openplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2377,10 +2377,6 @@ var Play = function () {
play_classPrivateFieldGet(_this, _Play_player, "f").getAd().playRequested = true;
}

if (IS_IOS && isAudio(play_classPrivateFieldGet(_this, _Play_player, "f").getElement()) && !play_classPrivateFieldGet(_this, _Play_player, "f").getElement().autoplay) {
play_classPrivateFieldGet(_this, _Play_player, "f").getElement().autoplay = true;
}

el.play();

play_classPrivateFieldGet(_this, _Play_events, "f").media.play();
Expand Down
47 changes: 2 additions & 45 deletions dist/openplayer.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/openplayer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/openplayer.min.js.map

Large diffs are not rendered by default.

8 changes: 1 addition & 7 deletions src/js/controls/play.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EventsList, PlayerComponent } from '../interfaces';
import Player from '../player';
import { EVENT_OPTIONS, IS_IOS } from '../utils/constants';
import { EVENT_OPTIONS } from '../utils/constants';
import { addEvent, isAudio } from '../utils/general';

class Play implements PlayerComponent {
Expand Down Expand Up @@ -47,12 +47,6 @@ class Play implements PlayerComponent {
this.#player.getAd().playRequested = true;
}

// This will force the playback of an audio element in iOS in the event
// of a delay less than 1000 ms; otherwise, blocking policies will come in effect
if (IS_IOS && isAudio(this.#player.getElement()) && !this.#player.getElement().autoplay) {
this.#player.getElement().autoplay = true;
}

el.play();
this.#events.media.play();
} else {
Expand Down

0 comments on commit ad251da

Please sign in to comment.