[wp-trac] [WordPress Trac] #31689: Media player not working with 302 redirects
WordPress Trac
noreply at wordpress.org
Tue Sep 15 20:22:12 UTC 2020
#31689: Media player not working with 302 redirects
---------------------------+------------------------------
Reporter: hlashbrooke | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 4.1.1
Severity: normal | Resolution:
Keywords: needs-testing | Focuses:
---------------------------+------------------------------
Changes (by desrosj):
* keywords: => needs-testing
* component: External Libraries => Media
* milestone: => Awaiting Review
Comment:
I did some testing on this today. Here's what I found.
In the Classic Editor, the behavior is as follows:
- Clicking "Add Media" and selecting "Insert from URL" leads to the file
being embedded as an HTML link.
- Inserting a `[audio fileurl="urlthatisaredirect"]` leads to a shortcode
preview that just hangs in the loading state.
In the block editor, the behavior is as follows:
- Inserting an audio block and clicking "Insert from URL" successfully
loads the audio player with the correct track length displayed in the
player. However, the audio cannot be previewed as none of the controls
work. This seems to happen regardless of whether the audio block is added
using a URL or by selecting an audio file in the media library. Even after
the page is reloaded, I still cannot preview an audio block. Viewing the
page on the front-end, the players are all usable and correctly process
the 302 link.
I'm wondering if this has to do with the function calling
`wp_check_filetype()`, which attempts to match a file type from a file
name. Because the URL does not include an extension, the function is
unable to accomplish that and `wp_audio_shortcode()` is returning without
any generated HTML to display an embed.
I have not had a chance to look into how the block editor implementation
is different, but the code responsible for generating the audio block
preview is doing something different. I'm going to move this back to the
Media component as it seems something is going on with the shortcode or
media related code and not the MediaElement.js code.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31689#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list