Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nginx-push-stream-module
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
nginx-push-stream-module
Commits
d5f2f449
Commit
d5f2f449
authored
Nov 14, 2011
by
Wandenberg Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changing global reference to iframe
parent
eae6a274
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
pushstream.js
misc/js/pushstream.js
+11
-9
No files found.
misc/js/pushstream.js
View file @
d5f2f449
...
...
@@ -30,8 +30,6 @@
var
PATTERN_MESSAGE
=
/
\{\"
id
\"
:
([\-\d]
*
)
,
\"
channel
\"
:
\"(
.*
)\"
,
\"
text
\"
:
\"(
.*
)\"\}
/
;
var
PATTERN_MESSAGE_WITH_EVENT_ID
=
/
\{\"
id
\"
:
([\-\d]
*
)
,
\"
channel
\"
:
\"(
.*
)\"
,
\"
text
\"
:
\"(
.*
)\"
,
\"
eventid
\"
:
\"(
.*
)\"\}
/
;
var
streamWrappersCount
=
0
;
var
Log4js
=
{
debug
:
function
()
{
if
(
PushStream
.
LOG_LEVEL
===
'
debug
'
)
Log4js
.
_log
.
apply
(
Log4js
.
_log
,
arguments
);
},
info
:
function
()
{
if
((
PushStream
.
LOG_LEVEL
===
'
info
'
)
||
(
PushStream
.
LOG_LEVEL
===
'
debug
'
))
Log4js
.
_log
.
apply
(
Log4js
.
_log
,
arguments
);
},
...
...
@@ -160,7 +158,7 @@
clearTimeout
(
timer
);
}
return
null
;
}
}
;
/* common callbacks */
var
onmessageCallback
=
function
(
event
)
{
...
...
@@ -266,8 +264,6 @@
this
.
url
=
null
;
this
.
frameloadtimer
=
null
;
this
.
pingtimer
=
null
;
this
.
streamId
=
"
streamWrapper_
"
+
streamWrappersCount
++
;
window
[
this
.
streamId
]
=
this
;
};
StreamWrapper
.
TYPE
=
"
Stream
"
;
...
...
@@ -281,8 +277,7 @@
}
catch
(
e
)
{
Log4js
.
error
(
"
[Stream] (warning) problem setting document.domain =
"
+
domain
+
"
(OBS: IE8 does not support set IP numbers as domain)
"
);
}
this
.
url
=
getSubscriberUrl
(
this
.
pushstream
,
this
.
pushstream
.
urlPrefixStream
);
this
.
url
+=
"
&streamid=
"
+
this
.
streamId
;
this
.
url
=
getSubscriberUrl
(
this
.
pushstream
,
this
.
pushstream
.
urlPrefixStream
)
+
"
&streamid=
"
+
this
.
pushstream
.
id
;
Log4js
.
debug
(
"
[Stream] connecting to:
"
,
this
.
url
);
this
.
loadFrame
(
this
.
url
);
},
...
...
@@ -462,9 +457,13 @@
/* mains class */
var
PushStreamManager
=
[];
var
PushStream
=
function
(
settings
)
{
settings
=
settings
||
{};
this
.
id
=
PushStreamManager
.
push
(
this
)
-
1
;
this
.
useSSL
=
settings
.
useSSL
||
false
;
this
.
host
=
settings
.
host
||
window
.
location
.
hostname
;
this
.
port
=
settings
.
port
||
(
this
.
useSSL
?
443
:
80
);
...
...
@@ -603,11 +602,13 @@
},
_onopen
:
function
()
{
this
.
reconnecttimer
=
clearTimer
(
this
.
reconnecttimer
);
this
.
_setState
(
PushStream
.
OPEN
);
this
.
_lastUsedMode
--
;
//use same mode on next connection
},
_onclose
:
function
()
{
this
.
reconnecttimer
=
clearTimer
(
this
.
reconnecttimer
);
this
.
_setState
(
PushStream
.
CLOSED
);
this
.
_reconnect
(
this
.
reconnecttimeout
);
},
...
...
@@ -652,12 +653,13 @@
// by a url parameter we find the stream wrapper instance
PushStream
.
register
=
function
(
iframe
)
{
var
matcher
=
iframe
.
window
.
location
.
href
.
match
(
/streamid=
(
.*
)
&
?
$/
);
if
(
matcher
[
1
]
&&
window
[
matcher
[
1
]])
{
window
[
matcher
[
1
]]
.
register
(
iframe
);
if
(
matcher
[
1
]
&&
PushStreamManager
[
matcher
[
1
]])
{
PushStreamManager
[
matcher
[
1
]].
wrapper
.
register
(
iframe
);
}
};
/* make class public */
window
.
PushStream
=
PushStream
;
window
.
PushStreamManager
=
PushStreamManager
;
})(
window
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment