Foliovision › Forums › FV Player › How to … › HLS video quality switching and cookie based protection
-
Hello,
I’m using 1080p videos and upon testing, the internet connection is capable to support the 1080p stream on playback. However, I’ve noticed that the quality switching on HLS videos isn’t possible before 30 seconds into the video. It remains on SD quality (360) all the way to 30 seconds. Is this done intentionally or is it a bug on my end? If intentionally, is there a way to reduce the time to allow an earlier switching?
Finally, I’ll like to look into cookie based protection addressed in this article: https://foliovision.com/player/securing-your-video/cookie-protection
However, I’m not using AWS or CloudFront to host my videos. I’m using Publitio. Is there a documentation I can look into to get started with other hosts?
Can you please advise?
Regards,
Kendell
-
-
Hello Kendell,
thank you for your question!
Regarding the cookie protection, contrary to the information in the article, FV Player does support signed URLs since November 2020. Thank you for bringing this outdated article to our attention, we will update the information.
URL Tokens are a better alternative to cookie based signing. To learn more about URL Tokens in FV Player and how to enable them, follow this link: https://foliovision.com/2020/11/hls-download-protection-cloudfront
This feature works with all CDNs supported by FV Player. However, we do not have any experience with our users using Publitio. It appears the hosting platform also acts as a CDN itself. It could work. Please, follow the guide above and enable the Stream Loader feature. Then send us a link to one of your videos, so that we could test out whether it works.
As for the HLS quality switching, while the switch does not happen immediately, the 30 seconds time is an issue on your end. I will ask our development team to see if they have any suggestions what could be causing this.
Thanks,
MariaHello Kendell,
1) what Maria means is that while we were planning to support the cookie signatures to be able to deliver HLS streams more securely we ended up creating the Stream Loader feature of FV Player Pro.
One of the reasons is that the cookie signature is not supported by a lot of the CDNs – I only know it’s supported by AWS CloudFront. Another reason is that a single cookie would give you access to all the video files. The advantage is that the cookie is not so obvious – you can’t see it in the video link.
2) HLS quality switching speed might be affected by the segment duration.
However we did improve this in upcoming FV Player 7.5 – when I play the video on https://foliovision.com/player/demos/encrypted-hls-stream I get the 1080p version right away. When I play with slower internet, I get 480p. If I choose I want 1080p, then it’s remembered and that’s what I always get in my browser, even if my internet is slow and I have to wait – so no ABR (automated quality selection streaming)
We have the above routine even in the current FV Player, but it’s not 100% reliable.
Thanks,
MartinHello Martin and Maria,
Many thanks for jumping in on this.
Happy to hear that the quality switching was addressed in the upcoming version. Any ETA?
In terms of the stream loader feature, I can try reaching out to Publitio to find out about their CDN and get back to you guys with more appropriate response on the subject.
Thanks
KendellHello Martin,
Thanks for the note. I had the chance to check it out.
I see that it remembers the quality I choose. Nice!
I was wondering, is there a filter or hook to over ride the default 30 seconds quality switch? Or maybe even force a particular quality to begin with?
I’m thinking maybe after 10 seconds I can show a 720p video or something of that nature.
Is it possible to do this? Can you please advise? Thanks!
Regards,
KendellHello Kendel,
we will get to this. It’s not so easy though as the HLS.js library which we use for HLS playback if focused on providing reliable ABR so that the video quality is switched automatically. It doesn’t have the parameters to force a quality reliably.
You can try to enable the “Force HD Streaming” setting in FV Player.
Thanks,
MartinHi,
Yes I had this setting on as well.
Please check this link for an example: https://clevered.gd/courses/interpersonal-skills/lesson/communication-skills/
Hello Kendell,
there are three issues –
1) because of the “Optimize FV Flowplayer JS loading” setting the player doesn’t appear until you start using the webpage as the dimensions are set to 100%. That way FV Player doesn’t know what aspect ratio should be used, but it assumes 16:9.
But I see we could fix that to work with the “Optimize FV Flowplayer JS loading”. In the meantime please set the player size to 1920 x 1080 in Settings -> FV Player Pro -> Sitewide FV Player Defaults and it will appear much better.
2) The transcript doesn’t appear – showing “Error loading trascript. Please try again in a minute. No transcript found”. Please try the latest FV Player Pro Beta: https://foliovision.com/player/basic-setup/switching-fv-player-pro-to-beta That one will hang on to the old cached transcript if it fails to load once. Previously a single failure would make the transcript disappear until it would be available again. So we improved that caching routine.
3) And last – the HLS stream is indeed quite slow to start. In my testing the first segment jbti6fli_2_0.ts took 30 seconds to load. But once I reloaded the page it only took 3 seconds to load. So perhaps your CDN is slow to pull the files. Actually I’m not sure if you media.c….gd server is a CDN or not.
Thanks,
MartinHi Martin,
Thanks for the feedback.
1. I followed your instructions and it loads a bit faster.
2. For that particular video there was no transcript uploaded. So this is fine for now. I have to find a way to hide this message.
3. I’ll look into my video hosting. I host with Publitio. So maybe it’s their CDN that’s lagging. Quick question. What tool did you use to test the HLS stream? Can you please share? I’ll like to further look into this issue.
Regards
Hello Kendell,
there are three issues –
1) perhaps we should improve that optimization to only work for non-logged in users and only on the first load. Once the scripts are cached in browser it doesn’t make sense to delay their loading.
3) I was checking these video segment loading times in Google Chrome developer tools. You can get the same stats in Firefox or Safari. Just look at the Network tab of the browser developer console and play the video – you will see these video segments loading.
Thanks,
MartinHello Kendell,
1) I had some time to think about the optimization and if we actually only make it work on the first load it would make troubleshooting any issues nearly impossible. The way it works now seems to be reliable enough, we only had 1 report of some issues where the user wanted the video to autoplay even without user interacting with the website.
Thanks,
Martin