当前位置: 首页 > news >正文

aliplayer Server returned 403 Forbidden (access denied)

'最近在接入阿里云播放器的sdk,项目的播放地址是m3u8的,h265的url

输入播放源以后播放报错,提示403,拒绝访问,起初以为是crt路径问题和key的问题,然后检查了以后没问题,后来又看了一下是不是白名单的问题,但是项目资源没通过阿里云平台存储

AVPUrlSource *source = [[AVPUrlSource alloc] urlWithString:xxx];[self.aliPlayer setUrlSource:source];

链接自带鉴权,需要配置token

AVPConfig *config = [self.aliPlayer getConfig];config.userAgent = [Tool getUserAgent];[_aliPlayer setConfig:config];

 getUserAgent

NSString *userAgent = nil;// User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43
#if SD_VISIONuserAgent = [NSString stringWithFormat:@"%@/%@ (%@; visionOS %@; Scale/%0.2f)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion], UITraitCollection.currentTraitCollection.displayScale];
#elif SD_UIKITuserAgent = [NSString stringWithFormat:@"%@/%@ (%@; iOS %@; Scale/%0.2f)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion], [[UIScreen mainScreen] scale]];
#elif SD_WATCHuserAgent = [NSString stringWithFormat:@"%@/%@ (%@; watchOS %@; Scale/%0.2f)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[WKInterfaceDevice currentDevice] model], [[WKInterfaceDevice currentDevice] systemVersion], [[WKInterfaceDevice currentDevice] screenScale]];
#elif SD_MACuserAgent = [NSString stringWithFormat:@"%@/%@ (Mac OS X %@)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[NSProcessInfo processInfo] operatingSystemVersionString]];
#endif

http://www.lryc.cn/news/384837.html

相关文章:

  • 单例模式(下)
  • 合约期VS优惠期,搞明白他们的区别才能避免很多坑!
  • 函数式反应式编程(FRP)在Scala中的实践与探索
  • NGINX配置web文件服务
  • deepspeed docker集群实现多机多卡训练----问题记录及解决方案资源汇总
  • 恢复 IntelliJ IDEA 中消失的菜单栏
  • 漏洞利用开发基础学习记录
  • 云通SIPX,您的码号资源智能调度专家!
  • 04-Mysql 索引,事务
  • U盘提示格式化怎么搞定?本文有5种方法(内含教程)
  • day02-登录模块-主页鉴权
  • git rebase的使用
  • LICEcap-开源GIF 屏幕录制工具
  • 【Java Web】会话管理
  • RestTemplate修改默认转换器,使用FastJsonConverter
  • 什么是div移动指令?如何用vue自定义指令实现?
  • Golang | Leetcode Golang题解之第187题重复的DNA序列
  • 智能猫砂盆到底是不是智商税?解救上班族双手的测评合集来了
  • java 数据新增、更新、删除监听,并记录日志或其他业务
  • developer.android.com在国内无法正常访问解决方法
  • 大学物理(下)笔记
  • Mind+在线图形编程软件(Sractch类软件)
  • 数智化招采供应链平台七大优点
  • Java面试题:对比HTTP的GET和POST方法,并讨论它们的使用场景
  • webpack+webpack server入门
  • Java内存模型以及多线程并发深度剖析
  • 【JS问题】require相对路径引入模块
  • SAP ABAP 常用实用类
  • 笔记本电脑录屏,教你3个方法,简单录屏
  • A-8 项目开源 qt1.0