From 745e4a6a87bef856c0294ecdfdbaa5092466b28f Mon Sep 17 00:00:00 2001 From: George Politis Date: Fri, 12 Sep 2014 13:37:57 +0200 Subject: [PATCH] Fixes simulcast layers ordering. --- simulcast.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/simulcast.js b/simulcast.js index 45b0f660c..f7217b568 100644 --- a/simulcast.js +++ b/simulcast.js @@ -633,8 +633,12 @@ function Simulcast() { navigator.webkitGetUserMedia(lqConstraints, function (lqStream) { + // NOTE(gp) The specification says Array.forEach() will visit + // the array elements in numeric order, and that it doesn't + // visit elements that don't exist. + // add lq trackid to local map - localMaps.msids.push(lqStream.getVideoTracks()[0].id); + localMaps.msids.splice(0, 0, lqStream.getVideoTracks()[0].id); hqStream.addTrack(lqStream.getVideoTracks()[0]); success(hqStream);