Embed: mews: fixes seek loop *knock on wood*
This commit is contained in:
parent
4efeb06c1d
commit
ac54fef930
2 changed files with 27 additions and 28 deletions
File diff suppressed because one or more lines are too long
|
@ -102,6 +102,7 @@ p.prototype.build = function (MistVideo,callback) {
|
||||||
|
|
||||||
var player = this;
|
var player = this;
|
||||||
//player.debugging = true;
|
//player.debugging = true;
|
||||||
|
//player.debugging = "dl"; //download appended data on ms close
|
||||||
|
|
||||||
//this function is called both when the websocket is ready and the media source is ready - both should be open to proceed
|
//this function is called both when the websocket is ready and the media source is ready - both should be open to proceed
|
||||||
function checkReady() {
|
function checkReady() {
|
||||||
|
@ -129,8 +130,7 @@ p.prototype.build = function (MistVideo,callback) {
|
||||||
player.ms.onsourceended = function(e){
|
player.ms.onsourceended = function(e){
|
||||||
if (player.debugging) console.error("ms ended",e);
|
if (player.debugging) console.error("ms ended",e);
|
||||||
|
|
||||||
//for debugging
|
if (player.debugging == "dl") {
|
||||||
|
|
||||||
function downloadBlob (data, fileName, mimeType) {
|
function downloadBlob (data, fileName, mimeType) {
|
||||||
var blob, url;
|
var blob, url;
|
||||||
blob = new Blob([data], {
|
blob = new Blob([data], {
|
||||||
|
@ -154,7 +154,6 @@ p.prototype.build = function (MistVideo,callback) {
|
||||||
a.remove();
|
a.remove();
|
||||||
};
|
};
|
||||||
|
|
||||||
if (player.debugging) {
|
|
||||||
var l = 0;
|
var l = 0;
|
||||||
for (var i = 0; i < player.sb.appended.length; i++) {
|
for (var i = 0; i < player.sb.appended.length; i++) {
|
||||||
l += player.sb.appended[i].length;
|
l += player.sb.appended[i].length;
|
||||||
|
@ -906,8 +905,8 @@ p.prototype.build = function (MistVideo,callback) {
|
||||||
value = (e.data.current*1e-3).toFixed(3);
|
value = (e.data.current*1e-3).toFixed(3);
|
||||||
var f = function() {
|
var f = function() {
|
||||||
video.currentTime = value;
|
video.currentTime = value;
|
||||||
if (video.currentTime != value) {
|
if (video.currentTime.toFixed(3) != value) {
|
||||||
if (player.debugging) console.log("Failed to set video.currentTime, wanted:",value,"got:",video.currentTime);
|
MistVideo.log("Failed to seek, wanted:",value,"got:",video.currentTime.toFixed(3));
|
||||||
player.sb._doNext(f);
|
player.sb._doNext(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue