Music playback src with hotlink protection cannot be played in iOS WeChat Mini Programs, but can be played in Android and development tools.

such as the question,

has added "servicewechat.com" to the whitelist of Qiniuyun;

but it still cannot be played in iOS WeChat Mini Programs;

it can also be played in ordinary src iOS;

playing audio with hotlink protection has no problem with development tools and Android, including the fact that these links can be opened on App and browsers.

I"ve seen that other solutions to hotlink protection in the community are only about hotlink protection through Referer. The key is that we are now using to set expiration time and signature , grab packets to distinguish requests from developers, Android and Mini Program playback controls on Apple, and find that the biggest difference of is that requests initiated by Mini Program playback controls on iOS will add Content-Type: application/octet-stream

.

I don"t know why Mini Program"s playback control on iOS added this setting. I tried and found that there was no way to control the HTTP request header.

Please anyone who has encountered this kind of problem, or who knows why this audio control behaves this way on iOS, can provide some solutions, please ~

Mar.11,2021
How is the

code written? Can you view music resources in network

Menu