1 Reply
      Latest reply on May 8, 2019 11:46 PM by himaswetha
      himaswetha Level 1 Level 1 (0 points)

        Hi All,

         

        I am able to retrieve the list of smpte-tt subtitles which are embedded inside id3 tag using the below url.

        https://stackoverflow.com/questions/46077711/does-avplayer-support-dvb-bitmap-subtitles.

         

        But how to render this timed metadata which is containing smpte-tt subtitles on iOS device?

         

        We need to use AVTimedMetadataGroup for legibleSelectionGroup and need to select from list of options - this method i tried but its not working.

         

        Please let me know how to render the smpte-tt subtitles which is embedded in id3 tag.

         

        Following code also not working to select the smpte-tt subtitle.

         

          AVMediaSelectionGroup* legibleSelectionGroup = [self.avPlayer.currentItem.asset mediaSelectionGroupForMediaCharacteristic: AVMediaCharacteristicLegible];

         

         

          for (AVMediaSelectionOption* legibleOption in legibleSelectionGroup.options)

          {

          for (AVMetadataItem* metadata in legibleOption.commonMetadata)

          {

          if ([languageCode caseInsensitiveCompare: (NSString*) metadata.value] == NSOrderedSame)

          {

          _subtitleLanguage = subtitleLanguage;

          NSLog(@"setSubtitleLanguage %@", self.subtitleLanguage);

          [self.avPlayer.currentItem selectMediaOption: legibleOption

          inMediaSelectionGroup: legibleSelectionGroup];

          break;

          }

          }

          }

         

        Thanks in advance