embed selfdetection fix
This commit is contained in:
parent
718d009f9f
commit
718c0b7f35
3 changed files with 58 additions and 4 deletions
42
lsp/server_screenlog.html
Normal file
42
lsp/server_screenlog.html
Normal file
File diff suppressed because one or more lines are too long
|
@ -14,7 +14,7 @@
|
|||
var embedtype = $('input[name=force]').val();
|
||||
|
||||
var info = document.createElement('script');
|
||||
info.src = 'http://'+window.location.hostname+':8080/info_'+streamName+'.js';
|
||||
info.src = 'http://'+(window.location.hostname == '' ? 'localhost' : window.location.hostname)+':8080/info_'+streamName+'.js';
|
||||
document.getElementById('embedcontainer').appendChild(info);
|
||||
info.onload = function(){
|
||||
if (embedtype == '') {
|
||||
|
|
18
src/embed.js
18
src/embed.js
|
@ -1,4 +1,18 @@
|
|||
function mistembed(streamname) {
|
||||
|
||||
//find the current script
|
||||
var me;
|
||||
if (('currentScript' in document) && (document.currentScript)) {
|
||||
me = document.currentScript;
|
||||
//not supported in old browsers :(
|
||||
}
|
||||
else {
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
me = scripts[scripts.length - 1];
|
||||
//not correct if the script is inserted dynamically, but this is how it used to be
|
||||
}
|
||||
|
||||
|
||||
// return the current flash version
|
||||
function flash_version() {
|
||||
var version = 0;
|
||||
|
@ -201,9 +215,7 @@ function mistembed(streamname) {
|
|||
}
|
||||
|
||||
var video = mistvideo[streamname],
|
||||
container = document.createElement('div'),
|
||||
scripts = document.getElementsByTagName('script'),
|
||||
me = scripts[scripts.length - 1];
|
||||
container = document.createElement('div');
|
||||
|
||||
if (me.parentNode.hasAttribute('data-forcetype')) {
|
||||
var forceType = me.parentNode.getAttribute('data-forcetype');
|
||||
|
|
Loading…
Add table
Reference in a new issue