Skip to content

Commit

Permalink
Merge pull request #536 from red5pro/bug/safari_rtcstats_RED5DEV-1029
Browse files Browse the repository at this point in the history
fix for stats on safari.
  • Loading branch information
bustardcelly authored Oct 25, 2023
2 parents 4cd9310 + 6ab5ce8 commit 86cdc1e
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions static/script/red5pro-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
) {
bytes = report.bytesSent
packets = report.packetsSent
if (report.mediaType === 'video' || report.id.match(vRegex)) {
if (
report.mediaType === 'video' ||
report.kind === 'video' ||
report.id.match(vRegex)
) {
if (lastResult && lastResult.get(report.id)) {
// calculate bitrate
bitrate =
Expand All @@ -89,7 +93,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
packets = report.packetsReceived
if (
ticket.audioOnly &&
(report.mediaType === 'audio' || report.id.match(aRegex))
(report.mediaType === 'audio' ||
report.kind === 'audio' ||
report.id.match(aRegex))
) {
if (lastResult && lastResult.get(report.id)) {
// calculate bitrate
Expand All @@ -100,7 +106,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
}
} else if (
!ticket.audioOnly &&
(report.mediaType === 'video' || report.id.match(vRegex))
(report.mediaType === 'video' ||
report.kind === 'video' ||
report.id.match(vRegex))
) {
if (lastResult && lastResult.get(report.id)) {
// calculate bitrate
Expand All @@ -116,7 +124,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
}
}
}
} else if (resolutionCb && report.type === 'track') {
} else if (
resolutionCb &&
(report.type === 'track' || report.kind === 'video')
) {
var fw = 0
var fh = 0
if (
Expand Down

0 comments on commit 86cdc1e

Please sign in to comment.