Repository: flutter
Issue: Play uncompleted video file not working on ios 
Labels: platform-ios,p: video_player,package,has reproducible steps,P3,found in release: 3.10,found in release: 3.11,team-ios,triaged-ios

I wanted to play a video using `video_player 2.6.1` from uncompleted (I just loaded 35% of the file using `flutter_downloader 1.10.4 `) mp4 file works in Android but in ios it shows the following error

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Steps to reproduce

This project is a reproduction of the bug just run it on ios and wait until you get the following error in the console

```
NSURLConnection finished with error - code -1002
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(VideoError, Failed to load video: Operation Stopped, null, null)
```

[https://github.com/saddem123/read-video-file-while-downloading](`Reproduction`)

### Expected results

Video player appear after downloading more than 35% of the video

### Actual results

```
NSURLConnection finished with error - code -1002
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(VideoError, Failed to load video: Operation Stopped, null, null)
```

### Code sample

<details><summary>Code sample</summary>

```dart
import 'dart:isolate';
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter_downloader/flutter_downloader.dart';
import 'package:path_provider/path_provider.dart';
import 'dart:io';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:video_player/video_player.dart';
import 'package:visibility_detector/visibility_detector.dart';


class TestPage extends StatefulWidget {
  const TestPage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<TestPage> createState() => _TestPageState();
}

class _TestPageState extends State<TestPage> {

  late VideoPlayerController _videoPlayerController;
  bool playerInitialized = false;


  String fileName = "video12.mp4";


  String? taskId;

  late String filePath;

  String testVideoUrl = "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4";

  final ReceivePort _port = ReceivePort();

  @override
  void initState() {
    super.initState();

    IsolateNameServer.registerPortWithName(_port.sendPort, 'downloader_send_port');
    _port.listen((dynamic data) async {
      String id = data[0];
      int status = data[1];
      int progress = data[2];

      if(progress > 35 && taskId != null && !playerInitialized){
        await FlutterDownloader.pause(taskId: taskId!);

        var file = File(filePath);
        // you can modify it to VideoPlayerController.file but it don't work for me
        _videoPlayerController = VideoPlayerController.network(
          file.absolute.path,
        );
        _videoPlayerController.initialize().then((value) => setState(() => playerInitialized = true));
      }
    });
    FlutterDownloader.registerCallback(downloadCallback);
    initPlayer();


  }

  @pragma('vm:entry-point')
  static void downloadCallback(String id, int status, int progress) {
    final SendPort? send = IsolateNameServer.lookupPortByName('downloader_send_port');
    send?.send([id, status, progress]);
  }

  Future<void> initPlayer() async {
    Directory appDocDirectory = await getApplicationDocumentsDirectory();
    String path = "${appDocDirectory.path}/videos";
    await Directory(path).create(recursive: true);
    FlutterDownloader.enqueue(
      url: testVideoUrl,
      savedDir: path,
      fileName: fileName,
      showNotification: false, // show download progress in status bar (for Android)
    ).then((value) {
      setState(() {
        taskId = value;
        filePath =  path + "/" +fileName;
      });
    }).onError((error, stackTrace) {
    });
  }


  @override
  Widget build(BuildContext context) {
    ScreenUtil.init(context);
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          children: [
            const SizedBox(height: 20,),
            playerInitialized ?
            VisibilityDetector(
              key: const Key("video"),
              onVisibilityChanged: (visibilityFraction){
                if(visibilityFraction.visibleFraction > 0.5){
                  _videoPlayerController.play();
                }
              },
              child: SizedBox(
                height: MediaQuery.of(context).size.width,
                width: MediaQuery.of(context).size.width * 16/9,
                child: VideoPlayer(
                  _videoPlayerController
                ),
              ),
            ) :
            Container()
          ],
        ),
      ),
    );
  }


  @override
  void dispose() async {
    _videoPlayerController.dispose();
    IsolateNameServer.removePortNameMapping('downloader_send_port');
    super.dispose();
  }
}




```

</details>

### Logs

<details><summary>Logs</summary>

```console
NSURLConnection finished with error - code -1002
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(VideoError, Failed to load video: Operation Stopped, null, null)
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(VideoError, Failed to load video: Operation Stopped, null, null)
```

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.1, on macOS 13.2.1 22D68 darwin-x64, locale en-FR)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] VS Code (version 1.78.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

• No issues found!
```

</details>