Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FRAG_LOAD_ERROR event not containing response code #4852

Closed
5 tasks done
kontrollanten opened this issue Aug 17, 2022 · 3 comments
Closed
5 tasks done

FRAG_LOAD_ERROR event not containing response code #4852

kontrollanten opened this issue Aug 17, 2022 · 3 comments

Comments

@kontrollanten
Copy link

What version of Hls.js are you using?

1.2.1

What browser (including version) are you using?

Brave 1.42.88 Chromium: 104.0.5112.81

What OS (including version) are you using?

macOS Version 12.5

Test stream

No response

Configuration

{
	"html5": {
		"preloadTextTracks": false,
		"hlsjsConfig": {
			"capLevelToPlayerSize": true,
			"autoStartLoad": false,
			"liveSyncDurationCount": 5,
			"abrEwmaDefaultEstimate": 306724880,
			"backBufferLength": 90,
			"startLevel": -1,
			"testBandwidth": false,
			"debug": false
		}
	},
	"textTrackSettings": false,
	"controls": true,
	"loop": false,
	"autoplay": "play",
	"poster": "http://localhost:9000/lazy-static/previews/7fcd791f-caf4-4c49-a386-c6c4d905055a.jpg",
	"inactivityTimeout": 2500,
	"playbackRates": [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2],
	"plugins": {
		"peertube": {
			"mode": "p2p-media-loader",
			"autoplay": "play",
			"videoViewUrl": "/api/v1/videos/a96fcceb-ea25-48af-a069-d39d0b6c7c03/views",
			"authorizationHeader": "Bearer 66c6081e1210e23cced39d40a60368efae8b57a8",
			"startTime": 0,
			"videoDuration": 1370,
			"videoCaptions": [],
			"isLive": false,
			"videoUUID": "a96fcceb-ea25-48af-a069-d39d0b6c7c03"
		},
		"hlsjs": {},
		"p2pMediaLoader": {
			"redundancyUrlManager": {
				"baseUrls": []
			},
			"type": "application/x-mpegURL",
			"startTime": 0,
			"src": "http://localhost:9000/static/streaming-playlists/hls/a96fcceb-ea25-48af-a069-d39d0b6c7c03/df1ba9a6-c9cf-403b-974f-84acc7003849-master.m3u8"
		}
	},
	"controlBar": {
		"children": {
			"playToggle": {},
			"nextVideoButton": {
				"type": "next"
			},
			"currentTimeDisplay": {},
			"timeDivider": {},
			"durationDisplay": {},
			"liveDisplay": {},
			"flexibleWidthSpacer": {},
			"progressControl": {
				"children": {
					"seekBar": {
						"children": {
							"loadProgressBar": {},
							"mouseTimeDisplay": {},
							"playProgressBar": {}
						}
					}
				}
			},
			"p2PInfoButton": {
				"p2pEnabled": true
			},
			"muteToggle": {},
			"volumeControl": {},
			"settingsButton": {
				"setup": {
					"maxHeightOffset": 40
				},
				"entries": ["playbackRateMenuButton", "resolutionMenuButton"]
			},
			"theaterButton": {},
			"fullscreenToggle": {}
		}
	}
}

Additional player setup steps

No response

Checklist

Steps to reproduce

  1. Manually configure the mp4 file response to be 429
  2. Log the error event; hls.on(Hlsjs.Events.ERROR, (event, data) => console.log(data))

Expected behaviour

{
	"type": "networkError",
	"details": "fragLoadError",
	"fatal": false,
	"frag": {
		...
	},
	"response": {
          "code": 429,
          "text": "Too Many Requests"
       }
}

What actually happened?

The response property is a string containing what should be in response.text.

Console output

{
	"type": "networkError",
	"details": "fragLoadError",
	"fatal": false,
	"frag": {
		...
	},
	"response": "Too Many Requests"
}


### Chrome media internals output

_No response_
@kontrollanten kontrollanten added Bug Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels Aug 17, 2022
@robwalch robwalch added Third-party issue and removed Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels Aug 17, 2022
@robwalch
Copy link
Collaborator

"Too Many Requests" is not a response provided from HLS.js. This is an issue with a custom loader or a use-case not supported by HLS.js.

@robwalch robwalch removed the Bug label Aug 17, 2022
@kontrollanten
Copy link
Author

The API doc says the response property should be an object, not a string:

Hls.ErrorDetails.FRAG_LOAD_ERROR - raised when fragment loading fails because of a network error
data: { type : NETWORK_ERROR, details : Hls.ErrorDetails.FRAG_LOAD_ERROR, fatal : true or false, frag : fragment object, response : { code: error code, text: error text } }

@robwalch
Copy link
Collaborator

Not a contribution

The description and error message suggests that a custom loader implemented outside of this project is being used. The loader is responsible for its output and for adhering to the interface, types, and expectations set forth in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants