How to secure streams from being embedded to unauthorized websites and domains with Ant Media Server? #4983
-
I can easily watch and embed any stream running on Ant Media Server with help of embed URL but also it seems as other with the stream information can use the URL on their websites too. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 23 replies
-
For workaround solutions in the Ant Media server (v2.4.3 or older versions) please check here. In v2.5.0 and above, you can allow selected domains through a single property file to let them embed the iframe code.
If you would like to allow multiple domains, then it should be like this.
Self is required to play the stream on the AMS dashboard panel itself. In this way, other than allowed domains, streams cannot be embedded using iframe code on other websites. |
Beta Was this translation helpful? Give feedback.
-
This solution works fine to secure the iframe embed code but in the case of HLS still, anyone can directly get the .m3u8 URL from the console and play that. Is there any way to allow the stream only for a specific domain if the iframe is not being used? Thank you |
Beta Was this translation helpful? Give feedback.
For workaround solutions in the Ant Media server (v2.4.3 or older versions) please check here.
In v2.5.0 and above, you can allow selected domains through a single property file to let them embed the iframe code.
To allow only specific domains to embed the iframe code, Go to the Advanced Application settings and add the below setting.
contentSecurityPolicyHeaderValue=frame-ancestors 'self' <https://allow-domain-name>;
If you would like to allow multiple domains, then it should be like this.
settings.contentSecurityPolicyHeaderValue=frame-ancestors 'self' <https://domain1> <https://domain2>;
Self is required to play the stream on the AMS dashboard panel itself. In this way, other than allo…