문제

AVMediaSelectionGroup *group  = _availableLanguages;
AVMediaSelectionOption *option = group.options;

In option there is 3 languages:

<AVMediaSelectionKeyValueOption: 0x1d931bb0, mediaType = soun, locale = fr, title = lang, option ID = 0>,
<AVMediaSelectionKeyValueOption: 0x1d931ce0, mediaType = soun, locale = en, title = lang, option ID = 1, default = YES>,
<AVMediaSelectionKeyValueOption: 0x1d931d10, mediaType = soun, locale = de, title = lang, option ID = 2>

)

Could somebody tell me how can I get AVMediaSelectionKeyValueOption: 0x1d931ce0, mediaType = soun, locale = en, title = lang, option ID = 1, default = YES? Default is not a property, so I don't know to find out if the default is yes or no.

Thanks

도움이 되었습니까?

해결책

I ran into exactly the same issue, so I'll post here my solution for other people looking for it.

It seems you cannot get the information from AVMediaSelectionKeyValueOption. However, you can get default option directly from AVMediaSelectionGroup. So all you need to do is this:

AVMediaSelectionOption *defaultOption = [group defaultOption];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top