Hello there,
in our team we were requested to add the possibility to manually select the video quality. I know that HLS is an adaptive stream and that depending on the network condition it choose the best quality that fits to the current situation.
I also tried some setting with preferredMaximumResolution and preferredPeakBitRate but none of them worked once the user was watching the steam. I also tried something like replacing the currentPlayerItem with the new configuration but anyway this only allowed me to downgrade the quality of the video. When I wanted to set it for example to 4k it did not change to that track event if I set a very high values to both params mentioned above.
My question is if there is any method which would allow me to force certain quality from the manifest file. I already have some kind of extraction which can parse the manifest file and provide me all the available information but I couldn't still figure out how to make the player reproduce specific stream with my desired quality from the available playlist.
in our team we were requested to add the possibility to manually select the video quality. I know that HLS is an adaptive stream and that depending on the network condition it choose the best quality that fits to the current situation.
I also tried some setting with preferredMaximumResolution and preferredPeakBitRate but none of them worked once the user was watching the steam. I also tried something like replacing the currentPlayerItem with the new configuration but anyway this only allowed me to downgrade the quality of the video. When I wanted to set it for example to 4k it did not change to that track event if I set a very high values to both params mentioned above.
My question is if there is any method which would allow me to force certain quality from the manifest file. I already have some kind of extraction which can parse the manifest file and provide me all the available information but I couldn't still figure out how to make the player reproduce specific stream with my desired quality from the available playlist.
As you've discovered, preferredMaximumResolution and preferredPeakBitRate should generally be sufficient to handle the mobile data case, where you want to downgrade network usage.
If the user wants to upgrade quality, I think it's not going to work out well to assume that a content quality decision can be made from the HLS playlist alone. The decision should probably be made at the content server, either with multiple static playlists pre-built for each quality level, or dynamic playlists generated at client request.
Keep in mind that stalling is not the only possible problem with high-quality streams. More likely, dropped frames and inconsistent frame rates might be perceived as lower quality than a lower quality variant that streams smoothly. This might be a case where giving the user the appearance of a choice leads to a worse outcome than no choice. (I'm not sure, but it's something worth thinking about.)
If the user wants to upgrade quality, I think it's not going to work out well to assume that a content quality decision can be made from the HLS playlist alone. The decision should probably be made at the content server, either with multiple static playlists pre-built for each quality level, or dynamic playlists generated at client request.
Keep in mind that stalling is not the only possible problem with high-quality streams. More likely, dropped frames and inconsistent frame rates might be perceived as lower quality than a lower quality variant that streams smoothly. This might be a case where giving the user the appearance of a choice leads to a worse outcome than no choice. (I'm not sure, but it's something worth thinking about.)