反应本机视频Cookie [英] React Native Video Cookies
问题描述
我正在尝试使用
对于IOS,我只需使用react-native-cookie-store库设置cookie:
CookieManager.set({名称:"CloudFront-Key-Pair-Id",值:您的对ID",域:您的域",小路: '/',origin:'您的来源(与域相同),版本:"1",到期时间:"2099-05-30T12:30:00.00-05:00",});
针对CloudFront-Key-Pair-Id,CloudFront-Policy和CloudFront-Signature调用了3次此方法.
希望这会有所帮助!
I am trying to play a secured video from CloudFront with @react-native-community/react-native-video.
To reproduce the video I have to set 3 cookies: CloudFront-Key-Pair-Id, CloudFront-Policy and CloudFront-Signature.
I've been able to reproduce the video in IOS with this module: react-native-cookies
But I am not being able to reproduce the video in android. How can I set the cookies to play this video?
The video is a .m3u8 extension (HLS)
Thank you very much!
I solved it.
Finally, to be able to reproduce it on Android I did the following on the Video component:
For IOS I just set the cookies with the react-native-cookie-store library:
CookieManager.set({
name:'CloudFront-Key-Pair-Id',
value: 'Your pair ID',
domain: 'Your domain',
path: '/',
origin: 'Your origin (I used same as domain)',
version: '1',
expiration: '2099-05-30T12:30:00.00-05:00',
});
Called this methods 3 times, for CloudFront-Key-Pair-Id, CloudFront-Policy and CloudFront-Signature.
Hope this helps!
这篇关于反应本机视频Cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!