Repository: flutter
Issue: [video_player] Support video, audio and text track selections
Labels: c: new feature,p: video_player,package,team-ecosystem,P3,triaged-ecosystem

## Use case
There have been multiple requests to support getting and setting `trackSelection`s for `video_player` plugin.
- https://github.com/flutter/flutter/issues/59437

## Proposal
Providing an easy way to get all types of `trackSelections` (like video, audio, and text) and set the requested track selection.
The current video player uses `auto` quality. `trackSelection`s are useful to change the qualities of video and audio and embedded audio languages manually and choose the text `trackSelection` which could be a caption in this proposal. Since the current video player uses a widget to present captions, this can't be done by backed like `exoplayer` (as mentioned in https://github.com/google/ExoPlayer/issues/8750#issuecomment-805668040 we can't get the complete `srt` file as string). Therefore, we should extract all embedded subtitle files by some tools like `ffmpeg` for `mp4` video files, then providing a method that returns a string of current subtitle file.

Some workarounds have been done in this repository (https://github.com/aliyazdi75/plugins/tree/feature_track_selection) that supports `android` getting and setting `trackSelection`, but not the subtitle method mentioned above and I needed to take some feedback about it. I haven't started the `ios` and `web` sides because I wanted to make sure this is a good way to implement this amazing feature.

**UPDATE:**
The current [`video_player_web`](https://github.com/flutter/plugins/blob/master/packages/video_player/video_player_web/lib/video_player_web.dart) uses simple `HTML` video player. As I explored there are some methods to get the video tracks:
- [`HTMLMediaElement.videoTracks`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/videoTracks)
- [`HTMLMediaElement.audioTracks`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/audioTracks)
- [`HTMLMediaElement.textTracks`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/textTracks)

But they are limited for almost every browser and are behind the `enable-experimental-web-platform-features` and need to enable by users. Furthermore, they don't provide our needs like `bitrate`.

For the second option, [Shaka Player](https://github.com/google/shaka-player) is another proposal that is blocked by https://github.com/flutter/flutter/issues/66931. By exploring its [API](https://shaka-player-demo.appspot.com/docs/api/index.html), the track represents as mentioned [here](https://shaka-player-demo.appspot.com/docs/api/shaka.extern.html#.Track) and they can be accessed by:
- [`getVariantTracks()`](https://shaka-player-demo.appspot.com/docs/api/shaka.Player.html#getVariantTracks)
- [`getTextTracks()`](https://shaka-player-demo.appspot.com/docs/api/shaka.Player.html#getTextTracks)
## TODO
This list contains all features mentioned above. Feel free to add yours and give your feedback. All ticked tasks are in the forked repository, feel free to make PRs to complete this feature, and finally, I will request a PR to merge them in the video player plugin.
- [ ] Get list of `trackselection` includes `auto` with their specifications for `video`, `audio` and `text`.
  - [x] `android`
  - [ ]  `ios`
  - [ ]  ~~`web`~~ (blocked by https://github.com/flutter/flutter/issues/66931)
- [x] Providing a class (`TrackSelectionNameResource`) which helps to change the suggestion `trackName` by the specific strings.
- [ ] Set the requested `trackSelection` includes `auto` for `video`, `audio` and `text`.
  - [x] `android`
  - [ ]  `ios`
  - [ ]  ~~`web`~~ (blocked by https://github.com/flutter/flutter/issues/66931)
- [ ] Providing a method to get the string of the currently embedded subtitle file.
  - [ ] `android`
  - [ ]  `ios`
  - [ ]  ~~`web`~~ (blocked by https://github.com/flutter/flutter/issues/66931)