Skip to content

Conversation

@rdm
Copy link

@rdm rdm commented Feb 13, 2019

The removed code would prevent the player definition from being delivered to the page in some cases.

The intent of the removed code was to prevent redundant player definitions, but:

  1. wordpress shortcode expansion does not mean that that expansion becomes a part of the currently constructed page (and I wish I had more details about specifically why this happens, but I don't have that right now).

  2. inspecting a sample player definition suggests that if we put player definition "A" on the page, then player definition "B" on the page, then an further attempt to use player definition "A" would instead use definition "B" with this "optimization" in place.

  3. but it's actually quite rare to have multiple video players on a page (so why are we optimizing for that case?), and

  4. browsers heavily cache javascript (so this optimization should not provide much benefit even when it would help)

Basically, if there's a real issue here, it should be addressed in the player definition itself. We're already over-optimized on the browser side.

Removing this mechanism prevents the video player from failing (with an undefined error) in a [relatively] common case.

The removed code would prevent the player definition from being delivered to the page.

The intent was to prevent redundant player definitions, but:

1) wordpress shortcode expansion does not mean that that expansion becomes a part of the currently constructed page.

2) inspecting a sample player definition suggests that if we put player definition a on the page, then player definition b on the page, then an further attempt to use player definition a would instead use definition b

3) but it's actually quite rare to have multiple video players on a page (so why are we optimizing for that case?), and

4) browsers heavily cache javascript (so this optimization should be of little benefit)

Basically, if there's a real issue here, it should be addressed in the player definition itself. We're already over-optimized on the browser side.

Removing this mechanism prevents the video player from failing (with an undefined error) in a [relatively] common case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant