<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>135507</bug_id>
          
          <creation_ts>2014-08-01 08:00:45 -0700</creation_ts>
          <short_desc>Video does not trigger &apos;error&apos; event for 403 error</short_desc>
          <delta_ts>2022-08-11 13:14:53 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.9</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Holroyd">meekohi</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>eric.carlson</cc>
    
    <cc>jer.noble</cc>
    
    <cc>meekohi</cc>
    
    <cc>rbuis</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1026238</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Holroyd">meekohi</who>
    <bug_when>2014-08-01 08:00:45 -0700</bug_when>
    <thetext>Correct behavior: error event should fire.
Current behavior: no event fires.

Reproduce with:

&lt;html&gt;
&lt;body&gt;&lt;/body&gt;
&lt;script&gt;
video = document.createElement(&quot;video&quot;);
video.addEventListener(&quot;error&quot;, function (err) {
  console.log(&quot;Could not load video&quot;);
});
video.src = &quot;https://spins.arqspin.com/2c0rjp53jqhf8/spin.mp4&quot;; // returns 403
video.load();
&lt;/script&gt;
&lt;/html&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1026467</commentid>
    <comment_count>1</comment_count>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2014-08-02 09:58:27 -0700</bug_when>
    <thetext>The media element doesn&apos;t see the 403 error because CFNetwork rejects the self-signed certificate used by https://spins.arqspin.com.

2014-08-02 09:53:13.025 com.apple.WebKit.WebContent.Development[640:32798] NSURLConnection/CFURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9843)
[09:53:13.027] HTTPRequest figHttpRequestDidFailCallback: Network error: domain=kCFErrorDomainCFNetwork, code=-1202, The certificate for this server is invalid. You might be connecting to a server that is pretending to be ?spins.arqspin.com? which could put your confidential information at risk. for https://spins.arqspin.com/2c0rjp53jqhf8/spin.mp4
MediaPlayerPrivateAVFoundation::assetStatus - statusOfValueForKey failed for duration, error = The certificate for this server is invalid. You might be connecting to a server that is pretending to be “spins.arqspin.com” which could put your confidential information at risk.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1026468</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2014-08-02 10:03:45 -0700</bug_when>
    <thetext>AVFoundation does return an error, so we try again with QTKit but loadState never changes from QTMovieLoadStateLoading (1000):

MediaPlayerPrivateQTKit::updateStates(0x7f9aea5a1f20) - exiting with networkState = 2, readyState = 0
2014-08-02 09:53:13.329 com.apple.WebKit.WebContent.Development[640:32798] NSURLConnection/CFURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9843)
[09:53:13.330] HTTPRequest figHttpRequestDidFailCallback: Network error: domain=kCFErrorDomainCFNetwork, code=-1202, The certificate for this server is invalid. You might be connecting to a server that is pretending to be ?spins.arqspin.com? which could put your confidential information at risk. for https://spins.arqspin.com/2c0rjp53jqhf8/spin.mp4
MediaPlayerPrivateQTKit::loadedRangesChanged(0x7f9aea5a1f20) - loadState = 1000</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1028125</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Holroyd">meekohi</who>
    <bug_when>2014-08-10 21:56:30 -0700</bug_when>
    <thetext>ugh stupid mistake when cleaning up the url. It should be

http://spins.arqspin.com/2c0rjp53jqhf8/spin.mp4

to avoid (irrelevant) SSL issues.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1451080</commentid>
    <comment_count>4</comment_count>
    <who name="Rob Buis">rbuis</who>
    <bug_when>2018-08-17 04:59:30 -0700</bug_when>
    <thetext>This seems to work fine these days.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1503316</commentid>
    <comment_count>5</comment_count>
    <who name="Lucas Forschler">lforschler</who>
    <bug_when>2019-02-06 09:19:07 -0800</bug_when>
    <thetext>Mass move bugs into the DOM component.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1890675</commentid>
    <comment_count>6</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-08-11 13:14:44 -0700</bug_when>
    <thetext>I am not able to reproduce this bug in Safari 15.6 on macOS based on the following JSFiddle (from Comment 0 and replacing URL from Comment 3 because HTTPS one was self-signed).

Link - https://jsfiddle.net/h3bampwz/

In all browsers (Chrome Canary 106, Firefox Nightly 105 and Safari 15.6), it shows &quot;Could not load video&quot; error message in Console, which is expected result.

I am going to mark this as &quot;RESOLVED CONFIGURATION CHANGED&quot;. Please reopen if you think it is incorrect testing or this issue is not resolved. Thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>