Title: [166250] trunk/Source/WebCore
- Revision
- 166250
- Author
- bfulg...@apple.com
- Date
- 2014-03-25 14:00:19 -0700 (Tue, 25 Mar 2014)
Log 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.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (166249 => 166250)
--- trunk/Source/WebCore/ChangeLog 2014-03-25 20:43:27 UTC (rev 166249)
+++ trunk/Source/WebCore/ChangeLog 2014-03-25 21:00:19 UTC (rev 166250)
@@ -1,3 +1,22 @@
+2014-03-25 Brent Fulgham <bfulg...@apple.com>
+
+ [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.
+
2014-03-25 Michael Saboff <msab...@apple.com>
Unreviewed, rolling out r166070.
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (166249 => 166250)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2014-03-25 20:43:27 UTC (rev 166249)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2014-03-25 21:00:19 UTC (rev 166250)
@@ -6042,16 +6042,21 @@
}
}
-bool HTMLMediaElement::doesHaveAttribute(const AtomicString& attribute) const
+bool HTMLMediaElement::doesHaveAttribute(const AtomicString& attribute, AtomicString* value) const
{
QualifiedName attributeName(nullAtom, attribute, nullAtom);
- if (!fastHasAttribute(attributeName))
+
+ AtomicString elementValue = fastGetAttribute(attributeName);
+ if (elementValue.isNull())
return false;
if (Settings* settings = document().settings()) {
- if (attributeName == HTMLNames::x_itunes_inherit_uri_query_componentAttr)
- return settings->enableInheritURIQueryComponent();
+ if (attributeName == HTMLNames::x_itunes_inherit_uri_query_componentAttr && !settings->enableInheritURIQueryComponent())
+ return false;
}
+
+ if (value)
+ *value = elementValue;
return true;
}
Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (166249 => 166250)
--- trunk/Source/WebCore/html/HTMLMediaElement.h 2014-03-25 20:43:27 UTC (rev 166249)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h 2014-03-25 21:00:19 UTC (rev 166250)
@@ -129,7 +129,7 @@
virtual bool supportsSave() const;
virtual bool supportsScanning() const override;
- virtual bool doesHaveAttribute(const AtomicString&) const override;
+ virtual bool doesHaveAttribute(const AtomicString&, AtomicString* value = nullptr) const override;
PlatformMedia platformMedia() const;
PlatformLayer* platformLayer() const;
Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (166249 => 166250)
--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp 2014-03-25 20:43:27 UTC (rev 166249)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp 2014-03-25 21:00:19 UTC (rev 166250)
@@ -1412,12 +1412,12 @@
registerMediaEngine(addMediaEngine);
}
-bool MediaPlayer::doesHaveAttribute(const AtomicString& attribute) const
+bool MediaPlayer::doesHaveAttribute(const AtomicString& attribute, AtomicString* value) const
{
if (!m_mediaPlayerClient)
return false;
- return m_mediaPlayerClient->doesHaveAttribute(attribute);
+ return m_mediaPlayerClient->doesHaveAttribute(attribute, value);
}
}
Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (166249 => 166250)
--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h 2014-03-25 20:43:27 UTC (rev 166249)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h 2014-03-25 21:00:19 UTC (rev 166250)
@@ -248,7 +248,7 @@
virtual HostWindow* mediaPlayerHostWindow() { return 0; }
virtual IntRect mediaPlayerWindowClipRect() { return IntRect(); }
virtual CachedResourceLoader* mediaPlayerCachedResourceLoader() { return 0; }
- virtual bool doesHaveAttribute(const AtomicString&) const { return false; }
+ virtual bool doesHaveAttribute(const AtomicString&, AtomicString* = 0) const { return false; }
#if ENABLE(VIDEO_TRACK)
virtual void mediaPlayerDidAddAudioTrack(PassRefPtr<AudioTrackPrivate>) { }
@@ -300,7 +300,7 @@
bool supportsSave() const;
bool supportsScanning() const;
bool requiresImmediateCompositing() const;
- bool doesHaveAttribute(const AtomicString&) const;
+ bool doesHaveAttribute(const AtomicString&, AtomicString* value = nullptr) const;
PlatformMedia platformMedia() const;
PlatformLayer* platformLayer() const;
#if PLATFORM(IOS)
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (166249 => 166250)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2014-03-25 20:43:27 UTC (rev 166249)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2014-03-25 21:00:19 UTC (rev 166250)
@@ -90,6 +90,13 @@
@end
#endif
+#if PLATFORM(IOS)
+@class AVPlayerItem;
+@interface AVPlayerItem (WebKitExtensions)
+@property (nonatomic, copy) NSString* dataYouTubeID;
+@end
+#endif
+
SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
SOFT_LINK_FRAMEWORK_OPTIONAL(CoreMedia)
SOFT_LINK_FRAMEWORK_OPTIONAL(CoreImage)
@@ -702,6 +709,12 @@
if (m_avPlayer)
[m_avPlayer.get() replaceCurrentItemWithPlayerItem:m_avPlayerItem.get()];
+#if PLATFORM(IOS)
+ AtomicString value;
+ if (player()->doesHaveAttribute("data-youtube-id", &value)) {
+ [m_avPlayerItem.get() setDataYouTubeID: value];
+ #endif
+
#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP) && HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT)
const NSTimeInterval legibleOutputAdvanceInterval = 2;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes