Reputation: 265
I am trying to run video from video_player flutter it works perfectly in android but in ios, I get the following error But sometimes it run after giving the error.
_controller = VideoPlayerController.network(widget._videoUrl)
..initialize().then((_) {
_controller.play();
setState(() {
this.duration = this._controller.value.duration.inSeconds;
this._controller.addListener(videoControlListner);
});
});
error:
_NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <241959D4-879B-4279-9E48-FE823592A71D>.<6>, NSLocalizedDescription=cancelled} [-999]
[C5.1 1D473D7C-2EF2-4AF5-99CD-CCAB9560AA45 192.168.1.13:51979<->52.216.160.155:443]
Connected Path: satisfied (Path is satisfied), interface: en0
Duration: 7.716s, DNS @0.004s took 0.008s, TCP @0.021s took 0.323s, TLS took 0.609s
bytes in/out: 24202/1709, packets in/out: 31/4, rtt: 0.315s, retransmitted packets: 0, out-of-order packets: 0
This behavior is only in IOS, Android runs fine.
Upvotes: 0
Views: 2614
Reputation: 785
The video player is not functional on iOS simulators. An iOS device must be used during development/testing.
Add the following entry to your Info.plist file, located in /ios/Runner/Info.plist:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
Upvotes: 2