-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
fix: several source setting inconsistencies and slight refactor #5054
Conversation
src/js/tech/html5.js
Outdated
@@ -46,7 +46,7 @@ class Html5 extends Tech { | |||
// 1) Check if the source is new (if not, we want to keep the original so playback isn't interrupted) | |||
// 2) Check to see if the network state of the tag was failed at init, and if so, reset the source | |||
// anyway so the error gets fired. | |||
if (source && (this.el_.currentSrc !== source.src || (options.tag && options.tag.initNetworkState_ === 3))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think removing the initNetworkState_
check breaks if not, we want to keep the original so playback isn't interrupted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we don't need a sourceset to happen during late init
?
daab41d
to
64d2f7b
Compare
c081e0b
to
c2ce2ef
Compare
src/js/player.js
Outdated
@@ -2612,8 +2612,6 @@ class Player extends Component { | |||
} | |||
|
|||
if (!titleCaseEquals(sourceTech.tech, this.techName_)) { | |||
this.changingSrc_ = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove this? Aren't we changing sources here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this because there were some cases where it would cause us to be stuck in changingSrc_ = true
. I think the better change though is to keep this line and then wait for the tech we loaded to be ready and then set changingSrc_ = false
.
src/js/tech/setup-sourceset.js
Outdated
const getSrc = (el) => { | ||
// We use the attribute to check if a source is set because when | ||
// the source for the element is set to a blank string. The attribute will | ||
// return '' and the property will return window.location.href. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
however, this is the actual url that the browser tried to load, why hide it?
src/js/utils/filter-source.js
Outdated
const mimetype = getMimeType(src.src); | ||
|
||
if (!src.type && mimetype) { | ||
src.type = mimetype; | ||
} | ||
|
||
src.src = getAbsoluteURL(src.src); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why change the source to be an absolute url?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should, I think this was leftover from some testing I was doing with absolute vs relative sources.
caac13a
to
cd5072b
Compare
a8635bb
to
1af2545
Compare
cd5072b
to
167f431
Compare
1af2545
to
b191398
Compare
Since this merges into #5040, we should wait until that one is approved before merging this in. |
c44adf5
to
a6ebacd
Compare
a6ebacd
to
428a904
Compare
Description
load
should always fire sourcesetmediaEl.src
->mediaEl.removeAttribute('src')
->load()
should fire a sourcesetsourceset
TODO