Changeset 166250 in webkit


Ignore:
Timestamp:
Mar 25, 2014 2:00:19 PM (10 years ago)
Author:
Brent Fulgham
Message:

[iOS] Pass additional options to AVFoundation during playback.
https://bugs.webkit.org/show_bug.cgi?id=130624

Reviewed by Eric Carlson.

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::doesHaveAttribute): Return attribute value if the user
passes a pointer to fill in.

  • html/HTMLMediaElement.h:
  • platform/graphics/MediaPlayer.cpp:

(WebCore::MediaPlayer::doesHaveAttribute):

  • platform/graphics/MediaPlayer.h:

(WebCore::MediaPlayerClient::doesHaveAttribute):

  • platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:

(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Pass additional
option if supplied by user.

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r166249 r166250  
     12014-03-25  Brent Fulgham  <bfulgham@apple.com>
     2
     3        [iOS] Pass additional options to AVFoundation during playback.
     4        https://bugs.webkit.org/show_bug.cgi?id=130624
     5
     6        Reviewed by Eric Carlson.
     7
     8        * html/HTMLMediaElement.cpp:
     9        (WebCore::HTMLMediaElement::doesHaveAttribute): Return attribute value if the user
     10        passes a pointer to fill in.
     11        * html/HTMLMediaElement.h:
     12        * platform/graphics/MediaPlayer.cpp:
     13        (WebCore::MediaPlayer::doesHaveAttribute):
     14        * platform/graphics/MediaPlayer.h:
     15        (WebCore::MediaPlayerClient::doesHaveAttribute):
     16        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
     17        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Pass additional
     18        option if supplied by user.
     19
    1202014-03-25  Michael Saboff  <msaboff@apple.com>
    221
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r166247 r166250  
    60436043}
    60446044
    6045 bool HTMLMediaElement::doesHaveAttribute(const AtomicString& attribute) const
     6045bool HTMLMediaElement::doesHaveAttribute(const AtomicString& attribute, AtomicString* value) const
    60466046{
    60476047    QualifiedName attributeName(nullAtom, attribute, nullAtom);
    6048     if (!fastHasAttribute(attributeName))
     6048
     6049    AtomicString elementValue = fastGetAttribute(attributeName);
     6050    if (elementValue.isNull())
    60496051        return false;
    60506052   
    60516053    if (Settings* settings = document().settings()) {
    6052         if (attributeName == HTMLNames::x_itunes_inherit_uri_query_componentAttr)
    6053             return settings->enableInheritURIQueryComponent();
    6054     }
     6054        if (attributeName == HTMLNames::x_itunes_inherit_uri_query_componentAttr && !settings->enableInheritURIQueryComponent())
     6055            return false;
     6056    }
     6057
     6058    if (value)
     6059        *value = elementValue;
    60556060   
    60566061    return true;
  • trunk/Source/WebCore/html/HTMLMediaElement.h

    r166247 r166250  
    130130    virtual bool supportsScanning() const override;
    131131   
    132     virtual bool doesHaveAttribute(const AtomicString&) const override;
     132    virtual bool doesHaveAttribute(const AtomicString&, AtomicString* value = nullptr) const override;
    133133
    134134    PlatformMedia platformMedia() const;
  • trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp

    r165928 r166250  
    14131413}
    14141414
    1415 bool MediaPlayer::doesHaveAttribute(const AtomicString& attribute) const
     1415bool MediaPlayer::doesHaveAttribute(const AtomicString& attribute, AtomicString* value) const
    14161416{
    14171417    if (!m_mediaPlayerClient)
    14181418        return false;
    14191419   
    1420     return m_mediaPlayerClient->doesHaveAttribute(attribute);
    1421 }
    1422 
    1423 }
    1424 
    1425 #endif
     1420    return m_mediaPlayerClient->doesHaveAttribute(attribute, value);
     1421}
     1422
     1423}
     1424
     1425#endif
  • trunk/Source/WebCore/platform/graphics/MediaPlayer.h

    r165928 r166250  
    249249    virtual IntRect mediaPlayerWindowClipRect() { return IntRect(); }
    250250    virtual CachedResourceLoader* mediaPlayerCachedResourceLoader() { return 0; }
    251     virtual bool doesHaveAttribute(const AtomicString&) const { return false; }
     251    virtual bool doesHaveAttribute(const AtomicString&, AtomicString* = 0) const { return false; }
    252252
    253253#if ENABLE(VIDEO_TRACK)
     
    301301    bool supportsScanning() const;
    302302    bool requiresImmediateCompositing() const;
    303     bool doesHaveAttribute(const AtomicString&) const;
     303    bool doesHaveAttribute(const AtomicString&, AtomicString* value = nullptr) const;
    304304    PlatformMedia platformMedia() const;
    305305    PlatformLayer* platformLayer() const;
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm

    r165998 r166250  
    9191#endif
    9292
     93#if PLATFORM(IOS)
     94@class AVPlayerItem;
     95@interface AVPlayerItem (WebKitExtensions)
     96@property (nonatomic, copy) NSString* dataYouTubeID;
     97@end
     98#endif
     99
    93100SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
    94101SOFT_LINK_FRAMEWORK_OPTIONAL(CoreMedia)
     
    703710        [m_avPlayer.get() replaceCurrentItemWithPlayerItem:m_avPlayerItem.get()];
    704711
     712#if PLATFORM(IOS)
     713    AtomicString value;
     714    if (player()->doesHaveAttribute("data-youtube-id", &value)) {
     715        [m_avPlayerItem.get() setDataYouTubeID: value];
     716 #endif
     717
    705718#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP) && HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT)
    706719    const NSTimeInterval legibleOutputAdvanceInterval = 2;
Note: See TracChangeset for help on using the changeset viewer.