Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't be able to get the Response.body value in Edge Beta browser while fetching manifest. #5164

Closed
Ravi-79 opened this issue Apr 21, 2023 · 15 comments · Fixed by #5180 or #5194
Closed
Assignees
Labels
browser: Chrome Issues affecting Chrome or Chromium derivatives (except Edge) browser: Edge Issues affecting Microsoft Edge (any version) priority: P0 Broken for everyone; no workaround; urgent status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@Ravi-79
Copy link

Ravi-79 commented Apr 21, 2023

Have you read the FAQ and checked for duplicate open issues?
Yes. There is no duplicate issues.

What version of Shaka Player are you using?

4.3.5
Can you reproduce the issue with our latest release version?
Yes

Can you reproduce the issue with the latest code from main?

Yes
Are you using the demo app or your own custom app?
Custom app,
Demo player. with custom manifest

If custom app, can you reproduce the issue using our demo app?
Yes

What browser and OS are you using?
Browser : Microsoft Edge (Beta)
Version 113.0.1774.15 (Official build) beta (64-bit)
OS:
Edition Windows 11 Enterprise
Version 22H2
Installed on ‎1/‎18/‎2023
OS build 22621.1555
Experience Windows Feature Experience Pack 1000.22640.1000.0

For embedded devices (smart TVs, etc.), what model and firmware version are you using?
Didn't test.

What are the manifest and license server URIs?
Manifest: https://amssamples.streaming.mediaservices.windows.net/3b970ae0-39d5-44bd-b3a3-3136143d6435/AzureMediaServicesPromo.ism/manifest(format=mpd-time-csf)

Demo Page URL:
https://shaka-player-demo.appspot.com/demo/#audiolang=en-US;textlang=en-US;uilang=en-US;asset=https://amssamples.streaming.mediaservices.windows.net/3b970ae0-39d5-44bd-b3a3-3136143d6435/AzureMediaServicesPromo.ism/manifest(format=mpd-time-csf);panel=CUSTOM%20CONTENT;build=uncompiled

What configuration are you using? What is the output of player.getConfiguration()?
{
"drm": {
"retryParameters": {
"maxAttempts": 2,
"baseDelay": 1000,
"backoffFactor": 2,
"fuzzFactor": 0.5,
"timeout": 30000,
"stallTimeout": 5000,
"connectionTimeout": 10000
},
"servers": {},
"clearKeys": {},
"advanced": {},
"delayLicenseRequestUntilPlayed": false,
"logLicenseExchange": false,
"updateExpirationTime": 1,
"preferredKeySystems": [],
"keySystemsMapping": {},
"parseInbandPsshEnabled": false
},
"manifest": {
"retryParameters": {
"maxAttempts": 2,
"baseDelay": 1000,
"backoffFactor": 2,
"fuzzFactor": 0.5,
"timeout": 30000,
"stallTimeout": 5000,
"connectionTimeout": 10000
},
"availabilityWindowOverride": null,
"disableAudio": false,
"disableVideo": false,
"disableText": false,
"disableThumbnails": false,
"defaultPresentationDelay": 0,
"segmentRelativeVttTiming": false,
"dash": {
"clockSyncUri": "",
"ignoreDrmInfo": false,
"disableXlinkProcessing": false,
"xlinkFailGracefully": false,
"ignoreMinBufferTime": false,
"autoCorrectDrift": true,
"initialSegmentLimit": 1000,
"ignoreSuggestedPresentationDelay": false,
"ignoreEmptyAdaptationSet": false,
"ignoreMaxSegmentDuration": false,
"keySystemsByURI": {
"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b": "org.w3.clearkey",
"urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e": "org.w3.clearkey",
"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed": "com.widevine.alpha",
"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95": "com.microsoft.playready",
"urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95": "com.microsoft.playready",
"urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb": "com.adobe.primetime"
},
"sequenceMode": false
},
"hls": {
"ignoreTextStreamFailures": false,
"ignoreImageStreamFailures": false,
"defaultAudioCodec": "mp4a.40.2",
"defaultVideoCodec": "avc1.42E01E",
"ignoreManifestProgramDateTime": false,
"mediaPlaylistFullMimeType": "video/mp2t; codecs="avc1.42E01E, mp4a.40.2"",
"useSafariBehaviorForLive": true,
"liveSegmentsDelay": 3
}
},
"streaming": {
"retryParameters": {
"maxAttempts": 2,
"baseDelay": 1000,
"backoffFactor": 2,
"fuzzFactor": 0.5,
"timeout": 30000,
"stallTimeout": 5000,
"connectionTimeout": 10000
},
"rebufferingGoal": 2,
"bufferingGoal": 10,
"bufferBehind": 30,
"ignoreTextStreamFailures": false,
"alwaysStreamText": false,
"startAtSegmentBoundary": false,
"gapDetectionThreshold": 0.5,
"durationBackoff": 1,
"forceTransmux": false,
"safeSeekOffset": 5,
"stallEnabled": true,
"stallThreshold": 1,
"stallSkip": 0.1,
"useNativeHlsOnSafari": true,
"inaccurateManifestTolerance": 2,
"lowLatencyMode": false,
"autoLowLatencyMode": false,
"forceHTTPS": false,
"preferNativeHls": false,
"updateIntervalSeconds": 1,
"dispatchAllEmsgBoxes": false,
"observeQualityChanges": false,
"maxDisabledTime": 30,
"parsePrftBox": false
},
"mediaSource": {
"sourceBufferExtraFeatures": ""
},
"offline": {
"usePersistentLicense": true,
"numberOfParallelDownloads": 5
},
"abr": {
"enabled": true,
"useNetworkInformation": true,
"defaultBandwidthEstimate": 1000000,
"switchInterval": 8,
"bandwidthUpgradeTarget": 0.85,
"bandwidthDowngradeTarget": 0.95,
"restrictions": {
"minWidth": 0,
"maxWidth": null,
"minHeight": 0,
"maxHeight": null,
"minPixels": 0,
"maxPixels": null,
"minFrameRate": 0,
"maxFrameRate": null,
"minBandwidth": 0,
"maxBandwidth": null
},
"advanced": {
"minTotalBytes": 128000,
"minBytes": 16000,
"fastHalfLife": 2,
"slowHalfLife": 5
},
"restrictToElementSize": false,
"restrictToScreenSize": false,
"ignoreDevicePixelRatio": false
},
"autoShowText": 3,
"preferredAudioLanguage": "",
"preferredTextLanguage": "",
"preferredVariantRole": "",
"preferredTextRole": "",
"preferredAudioChannelCount": 2,
"preferredVideoCodecs": [],
"preferredAudioCodecs": [],
"preferForcedSubs": false,
"preferredDecodingAttributes": [],
"restrictions": {
"minWidth": 0,
"maxWidth": null,
"minHeight": 0,
"maxHeight": null,
"minPixels": 0,
"maxPixels": null,
"minFrameRate": 0,
"maxFrameRate": null,
"minBandwidth": 0,
"maxBandwidth": null
},
"playRangeStart": 0,
"playRangeEnd": null,
"cmcd": {
"enabled": false,
"sessionId": "",
"contentId": "",
"useHeaders": false
},
"lcevc": {
"enabled": false,
"dynamicPerformanceScaling": true,
"logLevel": 0,
"drawLogo": false
}
}

What did you do?

step -1 : open Shaka Demo page in Edge Beta browser
step -2 : configure manifest with shaka Demo page
Step - 3: Play the video

What did you expect to happen?
Video Should be playing without error

What actually happened?
Throw an exception "Cannot read properties of null (reading 'getReader')"

image

@Ravi-79 Ravi-79 added the type: bug Something isn't working correctly label Apr 21, 2023
@Ravi-79 Ravi-79 changed the title Can't be able to get the Response.body value in Edge Beta browser. Can't be able to get the Response.body value in Edge Beta browser while fetching manifest. Apr 21, 2023
@github-actions github-actions bot added this to the v4.4 milestone Apr 21, 2023
@henriquebremenkanp
Copy link

henriquebremenkanp commented Apr 25, 2023

Same on Chrome Beta (113.0.5672.53)

I found it to be fixed by adding init.method = 'GET' just before this line:

response = await fetch(uri, init);

Don't know if it's the best solution or the right place to put it, but it works.
init.method being HEAD seems to be causing the response.body to be empty.

@LightTreason
Copy link

Note that the Chromium change that caused this is tracked at https://crbug.com/1297060.

@joeyparrish
Copy link
Member

Looks like we may need to make an adjustment. Forcing all HEAD requests to be GET requests is not a good fix, but it shouldn't be hard to work around this issue. Let me see what I can do.

@joeyparrish joeyparrish self-assigned this Apr 25, 2023
@joeyparrish joeyparrish added priority: P0 Broken for everyone; no workaround; urgent browser: Chrome Issues affecting Chrome or Chromium derivatives (except Edge) browser: Edge Issues affecting Microsoft Edge (any version) labels Apr 25, 2023
@theodab
Copy link
Contributor

theodab commented Apr 25, 2023

I think a better solution would be to modify how the fetch plugin handles HEAD requests.

The part of the code starting here:

const reader = response.clone().body.getReader();

We could just not load the body if the request method was HEAD. We won't be using it anyway in that case, right?

@joeyparrish
Copy link
Member

That's correct. Theodore, would you make that change?

@joeyparrish joeyparrish assigned theodab and unassigned joeyparrish Apr 25, 2023
theodab added a commit to theodab/shaka-player that referenced this issue Apr 25, 2023
This makes it so that we no longer try to download the body of a
head response, in the http fetch plugin. This is necessary due to
an upcoming change to Chromium, where the body object of such
responses is null.

Fixes shaka-project#5164
theodab added a commit that referenced this issue Apr 25, 2023
This makes it so that we no longer try to download the body of a head
response, in the http fetch plugin. This is necessary due to an upcoming
change to Chromium, where the body object of such responses is null.

Fixes #5164
@Ravi-79
Copy link
Author

Ravi-79 commented Apr 26, 2023

Hi @theodab , @joeyparrish ,
I tested this change (V4.4.0) in my local with above mentioned AMS sample manifest. It is working fine.
But if I try with the production manifest, I am getting the below mentioned error in networking_engine.js file.
image
image

joeyparrish pushed a commit that referenced this issue Apr 26, 2023
This makes it so that we no longer try to download the body of a head
response, in the http fetch plugin. This is necessary due to an upcoming
change to Chromium, where the body object of such responses is null.

Fixes #5164
joeyparrish pushed a commit that referenced this issue Apr 26, 2023
This makes it so that we no longer try to download the body of a head
response, in the http fetch plugin. This is necessary due to an upcoming
change to Chromium, where the body object of such responses is null.

Fixes #5164
joeyparrish pushed a commit that referenced this issue Apr 26, 2023
This makes it so that we no longer try to download the body of a head
response, in the http fetch plugin. This is necessary due to an upcoming
change to Chromium, where the body object of such responses is null.

Fixes #5164
joeyparrish pushed a commit that referenced this issue Apr 26, 2023
This makes it so that we no longer try to download the body of a head
response, in the http fetch plugin. This is necessary due to an upcoming
change to Chromium, where the body object of such responses is null.

Fixes #5164
joeyparrish pushed a commit that referenced this issue Apr 26, 2023
This makes it so that we no longer try to download the body of a head
response, in the http fetch plugin. This is necessary due to an upcoming
change to Chromium, where the body object of such responses is null.

Fixes #5164
@joeyparrish joeyparrish reopened this Apr 27, 2023
@joeyparrish
Copy link
Member

@theodab, please see above. Can you fix this, as well?

@joeyparrish
Copy link
Member

joeyparrish commented Apr 27, 2023

@Ravi-79, since you haven't provided us with content or steps to reproduce the issue in your latest comment, please try this edit in networking_engine.js:

Change:

      if (!responseAndGotProgress.gotProgress &&
          this.onProgressUpdated_ &&
          !response.fromCache &&
          type == shaka.net.NetworkingEngine.RequestType.SEGMENT) {

To:

      if (!responseAndGotProgress.gotProgress &&
          this.onProgressUpdated_ &&
          !response.fromCache &&
          request.method != 'HEAD' &&  // <---------------------- ADDED
          type == shaka.net.NetworkingEngine.RequestType.SEGMENT) {

Does this resolve the issue for you? I want to fix this ASAP, and I have already cherry-picked everything else for the release.

joeyparrish added a commit to joeyparrish/shaka-player that referenced this issue Apr 27, 2023
We should not look for response data in a HEAD request.

Fixes shaka-project#5164
@joeyparrish
Copy link
Member

Also available as PR #5194. Please let us know if this addresses the issue for you.

avelad pushed a commit that referenced this issue Apr 27, 2023
We should not look for response data in a HEAD request.

Fixes #5164
@Ravi-79
Copy link
Author

Ravi-79 commented Apr 27, 2023

Hi @joeyparrish ,
I tested with adding that condition ( request.method != 'HEAD' &&) in v4.3.x and the video is playing and also I can able to get the embedded caption.
But when testing with the branch main, I can't be able to display the embedded caption on video.
I can't be able to repro this step in Shaka demo player, because I do not have the free manifest with embedded caption on it.

@Ravi-79
Copy link
Author

Ravi-79 commented Apr 27, 2023

@Ravi-79, since you haven't provided us with content or steps to reproduce the issue in your latest comment, please try this edit in networking_engine.js:

Change:

      if (!responseAndGotProgress.gotProgress &&
          this.onProgressUpdated_ &&
          !response.fromCache &&
          type == shaka.net.NetworkingEngine.RequestType.SEGMENT) {

To:

      if (!responseAndGotProgress.gotProgress &&
          this.onProgressUpdated_ &&
          !response.fromCache &&
          request.method != 'HEAD' &&  // <---------------------- ADDED
          type == shaka.net.NetworkingEngine.RequestType.SEGMENT) {

Does this resolve the issue for you? I want to fix this ASAP, and I have already cherry-picked everything else for the release.

This solves the issue, I can be able to play the video.
As I mentioned earlier, I can't be able to show the embedded caption on the player. As our requirements are mostly concentrated on the embedded captions, we need to test and find the root cause for that issue once the latest Shaka library is available in CDN.

@Ravi-79
Copy link
Author

Ravi-79 commented Apr 27, 2023

@joeyparrish , If you have any free/common manifest with embedded caption to test, please share so we can test that also

@avelad
Copy link
Member

avelad commented Apr 27, 2023

@Ravi-79 please open a new issue for your embedded caption issue. Thanks!

@Ravi-79
Copy link
Author

Ravi-79 commented Apr 27, 2023

@Ravi-79 please open a new issue for your embedded caption issue. Thanks!
Thank you for the help @avelad .

joeyparrish added a commit that referenced this issue Apr 27, 2023
We should not look for response data in a HEAD request.

Fixes #5164
joeyparrish added a commit that referenced this issue Apr 27, 2023
We should not look for response data in a HEAD request.

Fixes #5164
joeyparrish added a commit that referenced this issue Apr 27, 2023
We should not look for response data in a HEAD request.

Fixes #5164
joeyparrish added a commit that referenced this issue Apr 27, 2023
We should not look for response data in a HEAD request.

Fixes #5164
@tietoevry-johan
Copy link

Hi, was this supposed to be fixed in 3.2.21? I'm still getting the error in latest Edge 113.0.1774.35: https://jsfiddle.net/3qs9twr0/3/

@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jun 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
browser: Chrome Issues affecting Chrome or Chromium derivatives (except Edge) browser: Edge Issues affecting Microsoft Edge (any version) priority: P0 Broken for everyone; no workaround; urgent status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
7 participants