Browse Source

replay

worker
langhuihui 7 years ago
parent
commit
e5caeb442f
  1. 5
      H5LiveClient.cpp
  2. 8
      H5LiveClient.js
  3. 26
      public/H5LiveClient.js

5
H5LiveClient.cpp

@ -98,10 +98,13 @@ struct H5LCBase
{
if (buffer.length() >= 13)
{
flvHeadRead = true;
if(buffer[0] == 'F' && buffer[1] == 'L' && buffer[2] == 'V'){
flvHeadRead = true;
buffer.offset = 13;
buffer.removeConsume();
}else{
call<void>("replay");
return;
}
buffer.consoleHex(13);
}

8
H5LiveClient.js

@ -329,7 +329,13 @@ mergeInto(LibraryManager.library, {
var _this = this;
var reconnectCount = 0;
var reconnectTime = 2000;
this.replay = function(){
this.ws.onmessage = null;
this.close();
setTimeout(function(){
_this.play(url,canvas,forceNoGL, contextOptions);
},1000);
}
function setWebsocket() {
this.$play(url);
this.ws.onopen = function() {

26
public/H5LiveClient.js
File diff suppressed because it is too large
View File

Loading…
Cancel
Save