Repository: flutter
Issue: [image_picker][iOS] Extension of file changes when loading a video in H264 using `pickMultipleMedia()` or `pickMedia()`
Labels: platform-ios,p: image_picker,package,team-ecosystem,has reproducible steps,P2,triaged-ecosystem,found in release: 3.16,found in release: 3.18

### 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

1. Create a new flutter project with flutter counter
2. Import package image_picker: 1.0.4
3. Setup the package by adding the following keys to the Info.plist file: NSPhotoLibraryUsageDescription, NSCameraUsageDescription, NSMicrophoneUsageDescription.
4. Update main.dart to have the same code as the Code sample.
5. Run the project on an IOS native device (NOT in emulator).
6. Tap the floatingActionButton to select a file from the photos app.
7. Select a video file encoded in H264.
8. See how the extension of the file is changed from the original extension to . JPG

### Expected results

The selected video file should have its original video extension as happens with `pickVideo()` method.

### Actual results

The selected video file has a new file extension (.jpg) This error only happens when using the `pickMultipleMedia()` or `pickMedia()` methods.

### Code sample

<details><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Image Picker Issue',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  XFile? media;

  void _uploadMedia() async {
    final List<XFile> pickedMedia = await ImagePicker().pickMultipleMedia();

    setState(() {
      media = pickedMedia.first;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Padding(
          padding: const EdgeInsets.all(8.0),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              const Text(
                'Path to picked file:',
              ),
              Text(
                '${media?.path}',
                style: Theme.of(context).textTheme.headlineMedium,
              ),
            ],
          ),
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _uploadMedia,
        child: const Icon(Icons.add),
      ),
    );
  }
}
```

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>



![VIDEO](https://github.com/flutter/flutter/assets/36243491/da637a1e-7920-46ce-92a0-87003b07ccd6)
![IMG_4432](https://github.com/flutter/flutter/assets/36243491/655ff9dc-93dc-4833-be17-bb36778cfc9d)
![IMG_4433](https://github.com/flutter/flutter/assets/36243491/8343b630-f6ab-444c-aa9d-6a78dce9cd00)



</details>

### Logs

<details><summary>Logs</summary>
No significant logs were found.
</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.16.1, on macOS 14.1.1 23B81 darwin-arm64, locale en-ES)
    • Flutter version 3.16.1 on channel stable at /Users/alex/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7f20e5d18c (10 days ago), 2023-11-27 09:47:30 -0800
    • Engine revision 22b600f240
    • Dart version 3.2.1
    • DevTools version 2.28.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/alex/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.13.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.84.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.78.0

[✓] Connected device (4 available)
    • iPhone de Melo (mobile) • 00008101-000A782E1150001E            • ios            • iOS 17.1.2 21B101
    • iPhone 15 (mobile)      • 19E0143A-93EE-4631-A6D8-19BA8CD9A1C0 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-0
      (simulator)
    • macOS (desktop)         • macos                                • darwin-arm64   • macOS 14.1.1 23B81 darwin-arm64
    • Chrome (web)            • chrome                               • web-javascript • Google Chrome 119.0.6045.199

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>