Not all subtitle tracks are SDH
[WebKit-https.git] / Source / WebCore / platform / graphics / avfoundation / objc / InbandTextTrackPrivateAVFObjC.mm
index 0d29b2a..a6b373b 100644 (file)
@@ -126,6 +126,20 @@ bool InbandTextTrackPrivateAVFObjC::isClosedCaptions() const
     return [[m_mediaSelectionOption mediaType] isEqualToString:AVMediaTypeClosedCaption];
 }
 
+bool InbandTextTrackPrivateAVFObjC::isSDH() const
+{
+    if (!m_mediaSelectionOption)
+        return false;
+    
+    if (![[m_mediaSelectionOption mediaType] isEqualToString:AVMediaTypeSubtitle])
+        return false;
+
+    if ([m_mediaSelectionOption hasMediaCharacteristic:AVMediaCharacteristicTranscribesSpokenDialogForAccessibility] && [m_mediaSelectionOption hasMediaCharacteristic:AVMediaCharacteristicDescribesMusicAndSoundForAccessibility])
+        return true;
+
+    return false;
+}
+    
 bool InbandTextTrackPrivateAVFObjC::containsOnlyForcedSubtitles() const
 {
     if (!m_mediaSelectionOption)