0

Developed an application in .NET Core to stream video content. Works great with html5 video element, 206 partial packets function (can seek properly). Once I try to stream a new different video, Chrome still plays the first video.

I don't have this issue in IE or Firefox, and frankly, used to work fine in Chrome last year. I suspect they changed something in Chrome recently?

Also, refreshing the page soft, hard or with cache reset will still play only the 1st video. Only by opening a new chrome tab does it seem to "reset" and allow me to play the 2nd video and vice-versa.

While the "incorrect" 1st video is playing, if I download directly via the Chrome HTML5 player icon on the bottom right, it downloads the correct 2nd video, which is even more bizarre!

Here is more information:

  • Chrome is latest ver 66.0
    • When I try to stream 2nd video, the 206 partial packets coming through the network ARE the data for the 2nd video, thus I can confirm the server is sending the 2nd video
    • This issue does NOT occur if during play of the 1st video, a second 206 packet is sent (as in, as long as I don't seek). If I don't seek, I can go between the 1st and 2nd video without an issue. Once a second 206 packet is requested, it seems chrome gets hell bent on sticking with the 1st video only during playback.
    • There is only 1 video player tag, but I can pick/choose videos from a list. I only play one video at a time.
Jack
  • 13
  • 4

1 Answers1

0

FIXED. Here is what caused the issue:

My request for the video was a GET to /Download?uid=12345, which in turn does a Redirect to /GetItem (the 12345 would be stored in a cookie).

Subsequent requests to partial 206 packets would also GET /GetItem. Did some reading, tried everything in the book, and realized Google Chrome may need to see a different URL for every new request, or it will play an older cached stream.

SOLUTION:

I changed my redirect to /GetItem?uid=someRandomNumber (which changes every time this action is called), and now, videos will stream correctly as I click between each one.

Jack
  • 13
  • 4