Issues to play HLS IOS 18

Michael

Member
Hello

We are currently receiving complaints from subscribers using IOS 18, the complaints are that the videos do not play when we use HLS protocol.

We tested on iOS 17 and other devices, and the videos play normally. It seems to be a problem only in this specific version, which is a recent release.

When using HLS, we are using the default implementation, without javascript for iOS devices, just the video tag, and placing the m3u8 list address in the video's src attribute, for Safari and Chrome.

For some cases we are using WebSDK, which seems working fine.

In iOS 18, the HLS video loads metadata (captured on loadedmetadata event), but the play method does not respond, just return a promise that never resolve.

I added an error listener to the video, and after trying to play for a few seconds, the error is thrown, but there is no additional information on error message.

We updated Flashphoner from version 5.2.1963 to version 5.2.2093, but it did not solve the problem.

We tested it on the demo https://demo.flashphoner.com/ and seems works, but the demo is on an older version than the latest tha we've updated: 5.2.2071, and we can not test with authentication, like we use on our website

This is our HLS settings in flashphoner.properties:
Code:
hls_access_control_headers=Access-Control-Allow-Origin: *;Access-Control-Allow-Methods: GET, HEAD;Access-Control-Max-Age: 3000;Access-Control-Expose-Headers: Accept-Ranges, Content-Range, Content-Encoding, Content-Length
hls_list_size=3
hls_min_list_size=2
hls_time=2
hls_time_min=2000
hls_auto_start=true
hls_preloader_enabled=true
hls_auth_enabled=true
client_acl_property_name=<secret>
hls_auth_token_cache=10
hls_segment_name_suffix_randomizer_enabled=true
hls_store_segment_in_memory=true
When the first subscriber connects, we see a lot of these errors in the log, could this have something to do with this problem?
Code:
16:38:08,914 ERROR lient-H264AccessUnit - Can't generate extradata, H264 can't generate extra data without sps/pps
16:38:08,914 INFO  -BitstreamNormalizer - Add config in key frame

Any tips on how to solve this problem?

Regards
 

Max

Administrator
Staff member
Good day.
There are no differences between 5.2.2071 and 5.2.2093 concerning HLS segments forming. So it seems like server setup or client code issue.
Please try to comment some parameters and use default settings like this:
Code:
hls_access_control_headers=Access-Control-Allow-Origin: *;Access-Control-Allow-Methods: GET, HEAD;Access-Control-Max-Age: 3000;Access-Control-Expose-Headers: Accept-Ranges, Content-Range, Content-Encoding, Content-Length
# hls_list_size=3
# hls_min_list_size=2
# hls_time=2
# hls_time_min=2000
hls_auto_start=true
hls_preloader_enabled=true
hls_auth_enabled=true
client_acl_property_name=<secret>
hls_auth_token_cache=10
hls_segment_name_suffix_randomizer_enabled=true
hls_store_segment_in_memory=true
Please also check if the issue is reproduced in HLS Native Player example. If not, modify the code to reproduce the issue and send us the code using this form.
 

Michael

Member
Hello

We spent a lot of time investigating until we discovered the problem.

On the HLS connection authentication, Flashphoner only allows to pass a single parameter by get method, and our system needs to pass more parameters to validate the connection, as the webrtc connection allows a json object. So we concatenate the parameters in a string using the "|" character as a separator, and spliting on our backend.

Even encoding the URL with javascript encodeURIComponent(), this new version of IOS has problems playing HLS videos with this character in the URL.

The request for the m3u8 list apparently occurs without problems, but in the following requests for the chunks, this new version of IOS fails, and must make the request without the query string params, triggering the problem (I'm not sure, just a thought).

We still see this error in the log, is it something we should be concerned about?

Code:
16:38:08,914 ERROR lient-H264AccessUnit - Can't generate extradata, H264 can't generate extra data without sps/pps
16:38:08,914 INFO -BitstreamNormalizer - Add config in key frame
Thanks for support
 

Max

Administrator
Staff member
On the HLS connection authentication, Flashphoner only allows to pass a single parameter by get method, and our system needs to pass more parameters to validate the connection, as the webrtc connection allows a json object. So we concatenate the parameters in a string using the "|" character as a separator, and spliting on our backend.
You can pass any additional parameters for your backend like this
Code:
https://wcs:8445/streamName/streamName.m3u8?aclAuth=1254789&param1=1&param2=2
Another way is to hex encode the parameters string, in this case you should decode it on backend
Code:
https://wcs:8445/streamName/streamName.m3u8?aclAuth=3132353437383926706172616d313d3126706172616d323d32
We still see this error in the log, is it something we should be concerned about?
This is normal behavior when encoding HLS segment media data, you should not concern about it.
 

Michael

Member
Hello

We changed the query string by replacing "|" with "-", since our params are already encoded, and do not have "-" character.

Now it is working as expected in IOS 18. Problem solved.

You can pass any additional parameters for your backend like this
Since which version has this become possible? Or has it always been possible?

Thanks
 
Top