Skip to content

Commit

Permalink
Added fix for issue described in #1924
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael Miranda committed Nov 8, 2016
1 parent 9759818 commit fef45a7
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
5 changes: 4 additions & 1 deletion build/mediaelement-and-player.js
Expand Up @@ -7366,7 +7366,10 @@ if (jQuery !== undefined) {
play: function () {
var t = this;

t.load();
// only load if the current time is 0 to ensure proper
if (t.media.getCurrentTime() <= 0) {
t.load();
}
t.media.play();
},
pause: function () {
Expand Down
2 changes: 1 addition & 1 deletion build/mediaelement-and-player.min.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion build/mediaelementplayer.js
Expand Up @@ -1547,7 +1547,10 @@ if (jQuery !== undefined) {
play: function () {
var t = this;

t.load();
// only load if the current time is 0 to ensure proper
if (t.media.getCurrentTime() <= 0) {
t.load();
}
t.media.play();
},
pause: function () {
Expand Down
2 changes: 1 addition & 1 deletion build/mediaelementplayer.min.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/js/mediaelement-renderer-flv.js
Expand Up @@ -3,6 +3,8 @@
*
* Uses flv.js, which is a JavaScript library which implements mechanisms to play flv files inspired by flv.js.
* It relies on HTML5 video and MediaSource Extensions for playback.
* Currently, it can only play files with the same origin.
*
* @see https://github.com/Bilibili/flv.js
*
*/
Expand Down Expand Up @@ -142,6 +144,7 @@
canPlayType: function (type) {

var mediaTypes = ['video/x-flv', 'video/flv'];

return mejs.MediaFeatures.hasMse && mediaTypes.indexOf(type) > -1;
},
/**
Expand All @@ -162,7 +165,7 @@
id = mediaElement.id + '_' + options.prefix,
flvPlayer,
stack = {}
;
;

node = originalNode.cloneNode(true);
options = mejs.Utils.extend(options, mediaElement.options);
Expand Down Expand Up @@ -273,6 +276,7 @@
}
}
}

node.className = '';

originalNode.parentNode.insertBefore(node, originalNode);
Expand Down
5 changes: 4 additions & 1 deletion src/js/mediaelementplayer-player.js
Expand Up @@ -1518,7 +1518,10 @@
play: function () {
var t = this;

t.load();
// only load if the current time is 0 to ensure proper
if (t.media.getCurrentTime() <= 0) {
t.load();
}
t.media.play();
},
pause: function () {
Expand Down

0 comments on commit fef45a7

Please sign in to comment.