Forum Replies Created
-
-
11 years ago in reply to: Using Amazon S3 signed URLs11 years ago in reply to: Using Amazon S3 signed URLs
Hello Martin,
After a bit of trial and error, I was able to isolate the problem to the flashvars parameter which is passed to flowplayer.swf. If there is a + in the Signature portion of the video url (encoded as %2B by either fvplayer or s3mv plugins), the video fails to load. The reason I believe this is happening is that the %2B is decoded back to a + before the media is requested from S3, which then decodes the + as a space, causing the request to fail. If the + remains encoded as %2B in the request to S3, the video loads fine.
I first attempted to resolve this by double-encoding that parameter (effectively encoding the % before the 2B), with the + now encoded as %252B in the page source. This also failed. Using Chrome dev tools, I could see that the url requested from S3 still had the + instead of %2B. I’m assuming that the flash player is decoding the url multiple times before finally requesting the file from S3. The solution that worked was to have the + encoded as %25252B. When encoded as such, the request to S3 now has a %2B instead of a + in the url.
I wrote a very simple plugin (attached to a private email) that overrides the [fvplayer] shortcode and does a quick regex search/replace on the S3 url portion of the output. I’m fairly new to PHP and WordPress, so there may be a better approach, but this seems to be working quite well for us at the moment.
I hope this helps!
– Jeremy