Automatic scalability in limited conditions

Hello everyone,
I’m sorry if this question is asked previously. I wasn’t able to find any useful information here, or anywhere tbh.

Quick background:
I’m using media server as a SFU.
I have producers with Simulcast which produces 3 layers of video.
I have mechanisms to manually set the max spatial layer on producer’s side .
I have mechanisms to manually set the set the preferred on consumer’s side.

Now I’m thinking about how to automate the process on produce’s and consumer’s side based on limited networking or device capabilities. For example: networking bandwidth is changed from 4g to 3g or there are several video stream produced and the device’s encoder is struggling which leads to inefficiencies or if the device is mobile, of high battery consumption and so on.

So far I’ve found 2 solutions to achieve this.

  1. Client side - use webrtc statistics to determine device / network capabilities and request lower / higher preferred layer.
  2. Server side - based on producer’s / consumer’s score to request lower / higher layer.

My main goal is to provide the best quality based on user device and network capabilities and also limit the server and it’s network workload when possible.

From my research I’ve found that Browsers have some kind of automation for this process, but the information is very little.

My questions are, am I on the right track? Is there any other solution to achieve this? What is your opinion for the client or server side implementation? Where I can find more information about this? Maybe there is a library that is capable of doing this but i’m not aware of. I’m open for any comments, opinions and suggestions.

Thank you very much for your support, time and opinion.