Skip to content

[iOS] Wrong audio track is set with different System Language #2441

@nara6500

Description

@nara6500

Unity version

6000.0.59f2

Unity editor platform

macOS

AVPro Video edition

Ultra

AVPro Video version

3.3.4

Device hardware

IPad Pro 2021

Which iOS version are you using?

26.2.1

Texture format

BGRA

Audio output

System Direct

Any other Media Player component configuration required to reproduce the issue.

No response

Which output component(s) are you using?

No response

Any other component configuration required to reproduce the issue.

No response

The issue

I have mp4 Videos with 2 Audiotracks. 0 = German, 1 = Englisch. On my german system language all works fine.
If I switch the system language to english and want to play the german track I hear english and see Track 0 selected. If I switch to Track 1 the I hear english still; after switching back to Track 0 I hear german.
This only happens if in my metadata the audio tracks are named as language = english/german.

I think IOS switches the audiotracks by metadata naming and the MediaPlayer first copies this switch. If I switch back and forth the ordiginal order is back?

In the demo App "Demo_Mediaplayer" add a video with with Track 0 = language = german, Track 1 = language= english in metadata. Set SystemLanugage to english.
Play:

  • Audio starts with english
  • go to settings and audio tracks (selected is track 0)
  • switch to track 1 (still english audio)
  • switch to track 0 (hear german audio)

My dirty fix at the moment that works:

foreach (AudioTrack track in _mediaPlayer.AudioTracks.GetAudioTracks()){ _mediaPlayer.AudioTracks.SetActiveAudioTrack(track); } _mediaPlayer.AudioTracks.SetActiveAudioTrack(_mediaPlayer.AudioTracks.GetAudioTracks()[PlayerPrefs.GetInt("language")]);

Media information

No response

Log output

Metadata

Metadata

Assignees

Labels

iOSiOS platformtriageNeeds triage

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions