Title: [105279] trunk
Revision
105279
Author
jer.no...@apple.com
Date
2012-01-18 08:39:05 -0800 (Wed, 18 Jan 2012)

Log Message

Mac fails to fire an 'error' event for a <video> <source> having an URL with no file extension
https://bugs.webkit.org/show_bug.cgi?id=76494

Reviewed by Eric Carlson.

No new tests; fixes compositing/video/video-with-invalid-source.html. Modified
media/video-source-error-no-candidate.html to check error condition.

When we run out of media engines for a given resource, inform the media player client
that resource loading failed by calling mediaPlayerResourceNotSupported().

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerResourceNotSupported):
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::loadWithNextMediaEngine):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerResourceNotSupported):

Modified Paths

Diff

Modified: trunk/LayoutTests/media/video-source-error-no-candidate-expected.txt (105278 => 105279)


--- trunk/LayoutTests/media/video-source-error-no-candidate-expected.txt	2012-01-18 16:06:55 UTC (rev 105278)
+++ trunk/LayoutTests/media/video-source-error-no-candidate-expected.txt	2012-01-18 16:39:05 UTC (rev 105279)
@@ -13,5 +13,8 @@
 EVENT(error) from <source id='empty-src' src=''> OK
 EXPECTED (video.error == 'null') OK
 
+EVENT(error) from <source id='no-extension-no-type' src=''> OK
+EXPECTED (video.error == 'null') OK
+
 END OF TEST
 

Modified: trunk/LayoutTests/media/video-source-error-no-candidate.html (105278 => 105279)


--- trunk/LayoutTests/media/video-source-error-no-candidate.html	2012-01-18 16:06:55 UTC (rev 105278)
+++ trunk/LayoutTests/media/video-source-error-no-candidate.html	2012-01-18 16:39:05 UTC (rev 105279)
@@ -8,7 +8,7 @@
 
             var sources = [];
             var errorCount = 0;
-            var expectedErrorCount = 4;
+            var expectedErrorCount = 5;
 
             function errorEvent(evt)
             {
@@ -52,6 +52,7 @@
             <source id=bogus-type src="" type="video/blahblah">
             <source id=unsupported-media-query src="" media=print>
             <source id=empty-src src="" type="video/mp4">
+            <source id=no-extension-no-type src=""
         </video>
         
         <p>Test that 'error' events are fired from &lt;source&gt; element when it can not be used.</p>

Modified: trunk/Source/WebCore/ChangeLog (105278 => 105279)


--- trunk/Source/WebCore/ChangeLog	2012-01-18 16:06:55 UTC (rev 105278)
+++ trunk/Source/WebCore/ChangeLog	2012-01-18 16:39:05 UTC (rev 105279)
@@ -1,3 +1,24 @@
+2012-01-17  Jer Noble  <jer.no...@apple.com>
+
+        Mac fails to fire an 'error' event for a <video> <source> having an URL with no file extension
+        https://bugs.webkit.org/show_bug.cgi?id=76494
+
+        Reviewed by Eric Carlson.
+
+        No new tests; fixes compositing/video/video-with-invalid-source.html. Modified 
+        media/video-source-error-no-candidate.html to check error condition.
+
+        When we run out of media engines for a given resource, inform the media player client
+        that resource loading failed by calling mediaPlayerResourceNotSupported().
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::mediaPlayerResourceNotSupported):
+        * html/HTMLMediaElement.h:
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::MediaPlayer::loadWithNextMediaEngine):
+        * platform/graphics/MediaPlayer.h:
+        (WebCore::MediaPlayerClient::mediaPlayerResourceNotSupported):
+
 2012-01-18  Alexandru Chiculita  <ach...@adobe.com>
 
         CSS Shaders: Parse float parameters for the custom() filter syntax

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (105278 => 105279)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2012-01-18 16:06:55 UTC (rev 105278)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2012-01-18 16:39:05 UTC (rev 105279)
@@ -2785,6 +2785,14 @@
     }
 }
 
+void HTMLMediaElement::mediaPlayerResourceNotSupported(MediaPlayer*)
+{
+    LOG(Media, "HTMLMediaElement::mediaPlayerResourceNotSupported");
+
+    // The MediaPlayer came across content which no installed engine supports.
+    mediaLoadingFailed(MediaPlayer::FormatError);
+}
+
 // MediaPlayerPresentation methods
 void HTMLMediaElement::mediaPlayerRepaint(MediaPlayer*)
 {

Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (105278 => 105279)


--- trunk/Source/WebCore/html/HTMLMediaElement.h	2012-01-18 16:06:55 UTC (rev 105278)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h	2012-01-18 16:39:05 UTC (rev 105279)
@@ -347,6 +347,7 @@
     virtual void mediaPlayerRateChanged(MediaPlayer*);
     virtual void mediaPlayerPlaybackStateChanged(MediaPlayer*);
     virtual void mediaPlayerSawUnsupportedTracks(MediaPlayer*);
+    virtual void mediaPlayerResourceNotSupported(MediaPlayer*);
     virtual void mediaPlayerRepaint(MediaPlayer*);
     virtual void mediaPlayerSizeChanged(MediaPlayer*);
 #if USE(ACCELERATED_COMPOSITING)

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (105278 => 105279)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2012-01-18 16:06:55 UTC (rev 105278)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2012-01-18 16:39:05 UTC (rev 105279)
@@ -394,8 +394,10 @@
         m_private->load(m_url);
     else {
         m_private = createNullMediaPlayer(this);
-        if (m_mediaPlayerClient)
+        if (m_mediaPlayerClient) {
             m_mediaPlayerClient->mediaPlayerEngineUpdated(this);
+            m_mediaPlayerClient->mediaPlayerResourceNotSupported(this);
+        }
     }
 }    
 

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (105278 => 105279)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2012-01-18 16:06:55 UTC (rev 105278)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2012-01-18 16:39:05 UTC (rev 105279)
@@ -135,6 +135,9 @@
     // element to an <embed> in standalone documents
     virtual void mediaPlayerSawUnsupportedTracks(MediaPlayer*) { }
 
+    // The MediaPlayer could not discover an engine which supports the requested resource.
+    virtual void mediaPlayerResourceNotSupported(MediaPlayer*) { }
+
 // Presentation-related methods
     // a new frame of video is available
     virtual void mediaPlayerRepaint(MediaPlayer*) { }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to