Changeset 166268 in webkit
- Timestamp:
- Mar 25, 2014 4:43:13 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r166264 r166268 1 2014-03-21 Jer Noble <jer.noble@apple.com> 2 3 [iOS] Enable caption support in full screen. 4 https://bugs.webkit.org/show_bug.cgi?id=130603 5 6 Reviewed by Eric Carlson. 7 8 Add TextTrackRepresentation support to MediaPlayerPrivateAVFoundationObjC. 9 10 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: 11 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: 12 (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer): Add the m_textTrackRepresenationLayer if present. 13 (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer): Ditto. 14 (WebCore::MediaPlayerPrivateAVFoundationObjC::requiresTextTrackRepresentation): True, if a m_videoFullscreenLayer is present. 15 (WebCore::MediaPlayerPrivateAVFoundationObjC::setTextTrackRepresentation): Remove the old, and add the new m_textTrackRepresenationLayer. 16 17 Make the text track container a stacking context for painting purposes. 18 * Modules/mediacontrols/mediaControlsiOS.css: 19 (video::-webkit-media-text-track-container): 20 1 21 2014-03-25 Brian Burg <bburg@apple.com> 2 22 -
trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css
r165676 r166268 296 296 overflow: hidden; 297 297 padding-bottom: 5px; 298 z-index: 0; 298 299 299 300 text-align: center; -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h
r165676 r166268 191 191 192 192 virtual bool hasSingleSecurityOrigin() const; 193 193 194 #if ENABLE(VIDEO_TRACK) 195 virtual bool requiresTextTrackRepresentation() const override; 196 virtual void setTextTrackRepresentation(TextTrackRepresentation*) override; 197 #endif 198 194 199 void createImageGenerator(); 195 200 void destroyImageGenerator(); … … 255 260 FloatRect m_videoFullscreenFrame; 256 261 MediaPlayer::VideoGravity m_videoFullscreenGravity; 262 RetainPtr<PlatformLayer> m_textTrackRepresentationLayer; 257 263 #endif 258 264 RetainPtr<WebCoreAVFMovieObserver> m_objcObserver; -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
r166256 r166268 49 49 #import "SecurityOrigin.h" 50 50 #import "SoftLinking.h" 51 #import "TextTrackRepresentation.h" 51 52 #import "UUID.h" 52 53 #import "VideoTrackPrivateAVFObjC.h" … … 512 513 if (m_videoFullscreenLayer) { 513 514 [m_videoLayer setFrame:CGRectMake(0, 0, m_videoFullscreenFrame.width(), m_videoFullscreenFrame.height())]; 514 [m_videoFullscreenLayer addSublayer:m_videoLayer.get()];515 [m_videoFullscreenLayer insertSublayer:m_videoLayer.get() atIndex:0]; 515 516 } 516 517 #endif … … 800 801 m_videoFullscreenLayer = videoFullscreenLayer; 801 802 802 if (!m_videoFullscreenLayer || !m_videoLayer) 803 return; 804 805 [m_videoLayer setFrame:CGRectMake(0, 0, m_videoFullscreenFrame.width(), m_videoFullscreenFrame.height())]; 806 [m_videoFullscreenLayer addSublayer:m_videoLayer.get()]; 803 CGRect frame = CGRectMake(0, 0, m_videoFullscreenFrame.width(), m_videoFullscreenFrame.height()); 804 805 if (m_videoFullscreenLayer && m_videoLayer) { 806 [m_videoLayer setFrame:frame]; 807 [m_videoFullscreenLayer insertSublayer:m_videoLayer.get() atIndex:0]; 808 } 809 810 if (m_videoFullscreenLayer && m_textTrackRepresentationLayer) { 811 CGRect textFrame = m_videoLayer ? [m_videoLayer videoRect] : frame; 812 [m_textTrackRepresentationLayer setFrame:textFrame]; 813 [m_videoFullscreenLayer addSublayer:m_textTrackRepresentationLayer.get()]; 814 } 807 815 } 808 816 … … 810 818 { 811 819 m_videoFullscreenFrame = frame; 812 if (!m_videoFullscreenLayer || !m_videoLayer) 813 return; 814 815 [m_videoLayer setFrame:CGRectMake(0, 0, frame.width(), frame.height())]; 820 if (!m_videoFullscreenLayer) 821 return; 822 823 if (m_videoLayer) 824 [m_videoLayer setFrame:CGRectMake(0, 0, frame.width(), frame.height())]; 825 826 if (m_textTrackRepresentationLayer) { 827 CGRect textFrame = m_videoLayer ? [m_videoLayer videoRect] : static_cast<CGRect>(frame); 828 [m_textTrackRepresentationLayer setFrame:textFrame]; 829 } 816 830 } 817 831 … … 1466 1480 { 1467 1481 determineChangedTracksFromNewTracksAndOldItems(m_cachedTracks.get(), AVMediaTypeVideo, m_videoTracks, &VideoTrackPrivateAVFObjC::create, player(), &MediaPlayer::removeVideoTrack, &MediaPlayer::addVideoTrack); 1482 } 1483 1484 bool MediaPlayerPrivateAVFoundationObjC::requiresTextTrackRepresentation() const 1485 { 1486 #if PLATFORM(IOS) 1487 if (m_videoFullscreenLayer) 1488 return true; 1489 #endif 1490 return false; 1491 } 1492 1493 void MediaPlayerPrivateAVFoundationObjC::setTextTrackRepresentation(TextTrackRepresentation* representation) 1494 { 1495 #if PLATFORM(IOS) 1496 PlatformLayer* representationLayer = representation ? representation->platformLayer() : nil; 1497 if (representationLayer == m_textTrackRepresentationLayer) 1498 return; 1499 1500 if (m_textTrackRepresentationLayer) 1501 [m_textTrackRepresentationLayer removeFromSuperlayer]; 1502 1503 m_textTrackRepresentationLayer = representationLayer; 1504 1505 if (m_videoFullscreenLayer && m_textTrackRepresentationLayer) { 1506 CGRect textFrame = m_videoLayer ? [m_videoLayer videoRect] : CGRectMake(0, 0, m_videoFullscreenFrame.width(), m_videoFullscreenFrame.height()); 1507 1508 [m_textTrackRepresentationLayer setFrame:textFrame]; 1509 [m_videoFullscreenLayer addSublayer:m_textTrackRepresentationLayer.get()]; 1510 } 1511 1512 #else 1513 UNUSED_PARAM(representation); 1514 #endif 1468 1515 } 1469 1516 #endif // ENABLE(VIDEO_TRACK)
Note: See TracChangeset
for help on using the changeset viewer.