Skip to content

Commit 34bfb12

Browse files
authored
fix: fix duplicate fmtp for vp9 on some old Android devices. (#758)
* fix: fix duplicate fmtp for vp9 on some old Android devices. * update. * fix duplicate vp9 on unmatched list. * update.
1 parent 840abc9 commit 34bfb12

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

lib/src/core/engine.dart

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,15 @@ extension EngineInternalMethods on Engine {
12261226

12271227
var matchesVideoCodec = codec == 'video/$videoCodec';
12281228
if (!matchesVideoCodec) {
1229-
unmatched.add(c);
1229+
if (lkPlatformIs(PlatformType.android) && codec == 'video/vp9') {
1230+
if (c.sdpFmtpLine != null &&
1231+
(c.sdpFmtpLine!.contains('profile-id=0') ||
1232+
c.sdpFmtpLine!.contains('profile-id=1'))) {
1233+
unmatched.add(c);
1234+
}
1235+
} else {
1236+
unmatched.add(c);
1237+
}
12301238
continue;
12311239
}
12321240
// for h264 codecs that have sdpFmtpLine available, use only if the
@@ -1240,7 +1248,15 @@ extension EngineInternalMethods on Engine {
12401248
}
12411249
continue;
12421250
}
1243-
matched.add(c);
1251+
if (lkPlatformIs(PlatformType.android) && codec == 'video/vp9') {
1252+
if (c.sdpFmtpLine != null &&
1253+
(c.sdpFmtpLine!.contains('profile-id=0') ||
1254+
c.sdpFmtpLine!.contains('profile-id=1'))) {
1255+
matched.add(c);
1256+
}
1257+
} else {
1258+
matched.add(c);
1259+
}
12441260
}
12451261
matched.addAll([...partialMatched, ...unmatched]);
12461262
try {

0 commit comments

Comments
 (0)