Improve playback, preroll and TV experience

This commit is contained in:
ponzischeme89
2026-08-10 07:11:14 +12:00
parent 598a4f5c75
commit d2f2eb62be
30 changed files with 1380 additions and 142 deletions
+6 -6
View File
@@ -297,12 +297,16 @@ func (c *Client) PlaybackInfo(
"UserId": {cred.UserID},
"IsPlayback": {"true"},
}
profile := androidTVDeviceProfile(capabilities)
if forceTranscode {
forceH264TranscodeProfile(profile)
}
body, err := json.Marshal(map[string]any{
"Id": itemID, "UserId": cred.UserID, "IsPlayback": true,
"StartTimeTicks": startTicks, "EnableDirectPlay": !forceTranscode,
"EnableDirectStream": !forceTranscode, "EnableTranscoding": true,
"AllowVideoStreamCopy": true, "AllowAudioStreamCopy": true,
"DeviceProfile": androidTVDeviceProfile(capabilities),
"AllowVideoStreamCopy": !forceTranscode, "AllowAudioStreamCopy": true,
"DeviceProfile": profile,
})
var requestBody map[string]any
if err == nil {
@@ -314,10 +318,6 @@ func (c *Client) PlaybackInfo(
if currentPlaySessionID != "" {
requestBody["CurrentPlaySessionId"] = currentPlaySessionID
}
if forceTranscode {
profile := requestBody["DeviceProfile"].(map[string]any)
profile["DirectPlayProfiles"] = []map[string]string{}
}
if err == nil {
body, err = json.Marshal(requestBody)
}