0

video_player:^2.1.4 我的服务器请求标头授权,我已将其插入标头:

VideoPlayerController controller = VideoPlayerController.network({URL}, httpHeaders: { 'Authorization': 'Bearer ${token}' });

但是好像不行!我给出错误:

PlatformException(MEDIA_ERR_SRC_NOT_SUPPORTED, No further diagnostic information can be determined or provided., The video has been found to be unsuitable (missing or in a format not supported by your browser)., null)

#additional:在 Flutter Web 应用程序上播放视频时出现此错误

谁能帮我?非常感谢!

4

1 回答 1

0

所以,我发现了问题。因为这个包写在 VideoElement - html 库上,但是 VideoElement 不支持 header 认证。如果flutter dev不支持它,看起来这将陷入停顿!

https://api.flutter.dev/flutter/dart-html/VideoElement-class.html https://github.com/flutter/plugins/blob/master/packages/video_player/video_player_web/lib/video_player_web.dart

我在 github https://github.com/flutter/flutter/issues/83602上创建了问题

于 2021-05-31T16:36:40.363 回答