Playback errors with a preferred quality set, on some devices
This commit is contained in:
1 parent
9200bd1c74
commit
367634fd94
4 files changed
+20
-34
No files matched your search
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Small security fixes
|
||||
- SponsorBlock skip looping back to the start of a segment on some devices, and overlapping segments
|
||||
- Live streams buffering on slow networks
|
||||
- Playback errors with a preferred quality set, on some devices
|
||||
|
||||
### Changed
|
||||
|
||||
|
||||
@@ -30,20 +30,19 @@ namespace ErrorDialogController
|
||||
}
|
||||
end function
|
||||
|
||||
' A Video state=error. Retry the next stream URL only before the first successful play, only for a
|
||||
' stream/format error (http / mediaerror), and only if a next URL exists; otherwise a dialog. On retry the
|
||||
' coordinator re-applies the initial seek (SeekToInitialPosition).
|
||||
function DecideVideoError(content as object, errorInfo as object, videoPlayedSuccessfully as boolean) as object
|
||||
if not videoPlayedSuccessfully and content <> invalid and IsAssociativeArray(errorInfo)
|
||||
category = ValidString(errorInfo.category)
|
||||
if category = "http" or category = "mediaerror"
|
||||
nextUrl = ErrorDialogController.NextStreamUrl(content)
|
||||
if nextUrl <> invalid
|
||||
return {
|
||||
action: ErrorDialogController.Action.Retry
|
||||
nextUrl: nextUrl
|
||||
}
|
||||
end if
|
||||
' A Video state=error. Before the first successful play, whatever the error, retry the next stream URL if one
|
||||
' exists; otherwise a dialog. The URLs are variants of one source (quality-filtered first, then unfiltered,
|
||||
' then proxied), and a filtered manifest the device can't play fails under more than one category
|
||||
' (telemetry: mediaplayer and mediaerror). On retry the coordinator re-applies the initial seek
|
||||
' (SeekToInitialPosition).
|
||||
function DecideVideoError(content as object, videoPlayedSuccessfully as boolean) as object
|
||||
if not videoPlayedSuccessfully and content <> invalid
|
||||
nextUrl = ErrorDialogController.NextStreamUrl(content)
|
||||
if nextUrl <> invalid
|
||||
return {
|
||||
action: ErrorDialogController.Action.Retry
|
||||
nextUrl: nextUrl
|
||||
}
|
||||
end if
|
||||
end if
|
||||
|
||||
|
||||
@@ -863,7 +863,7 @@ function OnVideoError() as void
|
||||
failedUrl = content.url
|
||||
failedUrlIndex = content.playletStreamUrlIndex
|
||||
|
||||
decision = ErrorDialogController.DecideVideoError(content, errorInfo, m.videoPlayedSuccessfully)
|
||||
decision = ErrorDialogController.DecideVideoError(content, m.videoPlayedSuccessfully)
|
||||
|
||||
if decision.action = ErrorDialogController.Action.Retry
|
||||
LogInfo("error retry -> next stream url=", decision.nextUrl)
|
||||
|
||||
@@ -52,42 +52,28 @@ namespace Tests
|
||||
|
||||
@describe("playback error decision")
|
||||
|
||||
@it("retries the next stream url on an http error before playing")
|
||||
@it("retries the next stream url before the first play")
|
||||
function _()
|
||||
content = { videoId: "v", playletStreamUrls: ["a", "b"], playletStreamUrlIndex: 0, url: "a" }
|
||||
d = ErrorDialogController.DecideVideoError(content, { category: "http" }, false)
|
||||
d = ErrorDialogController.DecideVideoError(content, false)
|
||||
m.assertEqual(d.action, ErrorDialogController.Action.Retry)
|
||||
m.assertEqual(d.nextUrl, "b")
|
||||
m.assertEqual(content.url, "b")
|
||||
end function
|
||||
|
||||
@it("retries on a mediaerror category")
|
||||
function _()
|
||||
content = { videoId: "v", playletStreamUrls: ["a", "b"], playletStreamUrlIndex: 0, url: "a" }
|
||||
d = ErrorDialogController.DecideVideoError(content, { category: "mediaerror" }, false)
|
||||
m.assertEqual(d.action, ErrorDialogController.Action.Retry)
|
||||
m.assertEqual(d.nextUrl, "b")
|
||||
end function
|
||||
|
||||
@it("shows a dialog when no next url exists")
|
||||
function _()
|
||||
content = { videoId: "v", playletStreamUrls: ["a"], playletStreamUrlIndex: 0, url: "a" }
|
||||
d = ErrorDialogController.DecideVideoError(content, { category: "http" }, false)
|
||||
d = ErrorDialogController.DecideVideoError(content, false)
|
||||
m.assertEqual(d.action, ErrorDialogController.Action.Dialog)
|
||||
end function
|
||||
|
||||
@it("shows a dialog once the stream has already played (no stream-swap)")
|
||||
function _()
|
||||
content = { videoId: "v", playletStreamUrls: ["a", "b"], playletStreamUrlIndex: 0, url: "a" }
|
||||
d = ErrorDialogController.DecideVideoError(content, { category: "http" }, true)
|
||||
m.assertEqual(d.action, ErrorDialogController.Action.Dialog)
|
||||
end function
|
||||
|
||||
@it("shows a dialog for a non-stream error category")
|
||||
function _()
|
||||
content = { videoId: "v", playletStreamUrls: ["a", "b"], playletStreamUrlIndex: 0, url: "a" }
|
||||
d = ErrorDialogController.DecideVideoError(content, { category: "drm" }, false)
|
||||
d = ErrorDialogController.DecideVideoError(content, true)
|
||||
m.assertEqual(d.action, ErrorDialogController.Action.Dialog)
|
||||
m.assertEqual(content.url, "a")
|
||||
end function
|
||||
|
||||
end class
|
||||
|
||||
Reference in new issue
Block a user