This might happen if the feature service is not starting. When you go to the Turn on media streaming button, it is either greyed out or does not respond when you click on it. If you are experiencing this issue you can try some of the below troubleshooting.
-Fix missing Media Feature Pack
-Check if the “Automatically allow devices to play my media” option is enabled
-Enable Windows Search Indexing
-Replace the Media Player cache folder
Check related services
To ensure that related services are up and running, observe the steps below:
-To open Services, go to the Windows Search bar and type services.msc.
-Locate the UPnP host service in the list and right-click on it. Click on Properties from the menu.
-Set the Startup type to Automatic.
-Click on Stop > Start to restart the service.
-Click OK.
-Close Services and see if you can now use Media Streaming.
Hope this resolves your Query!!
--If the reply is helpful, please Upvote and Accept it as an answer--