• Skip to content
  • Skip to primary sidebar
  • Skip to footer

Foliovision

Main navigation

  • Weblog
    • FV Player
    • WordPress
    • Video of the Week
    • Case Studies
    • Business
  • About
    • Testimonials
    • Meet the Team
    • We Support
    • Careers
    • Contact
    • Pricing
  • Products
  • Support
    • FV Player Docs
    • Pro Support
  • Login
  • Basket is empty

Using Amazon S3 signed URLs

[Solved]

Foliovision › Forums › FV Player › Requests and Feedback › Using Amazon S3 signed URLs

  • Jason D. 11 years, 10 months ago

    Hello,

    I’m using a piece of code to generate a signed Amazon URL for the video and feeding that URL to the FV WP Flowplayer short code.

    When the URL has “%” symbols in the signature, the player is converting parts of the signature into HTML Entities.

    Example, when I supply the following, signed URL…

    http://…//cdn.foliovision.com/file.mp4?AWSAccessKeyId…&Expires=1373240008&Signature=lOLsfId2a%2B5If….mQY%3D

    The player sends the following request to amazon…

    http://…//cdn.foliovision.com/file.mp4?AWSAccessKeyId=…&Expires=1373240008&Signature=lOLsfId2a+5If…mQY=

    Notice that the plugin converted the “%2B” in the signature to a “+” and the “%3D” to an “=”

    This URL is – of course rejected by Amazon.

    Is there a way for me to used signed URLs and NOT have the plugin alter the signature in this way?

    Hoping you can help.

    Jason

Viewing 22 replies - 1 through 22 (of 22 total)
  • Martin 12 years ago

    Hello Jason,

    thank you for the bug report.

    We will look into this tomorrow.

    What plugin are you using the secure Amazon S3 URLs? We would like to integrate this in our plugin.

    Thanks,
    Martin

    Jason D. 12 years ago

    Martin,

    I’m using S3mediavault to create the urls that I then pass to FV WordPress Flowplayer.

    If you wanted to build this feature into the your plugin – which would be awesome – the Amazon API explains everything:

    http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html

    I reached out to a developer friend of mine who was able to build me a quick plugin to deal with the “%2B” issue that I was having below, so everything is working for me now. If you like I can put you in touch with him…

    Jason

    Martin 12 years ago

    Hello Jason,

    thank you for the explanation.

    If you could put us in touch with your friend, or just send us his plugin, that would be great. We could include the fix in our plugin and make sure it works across all the future versions too.

    Thanks,
    Martin

    Jeremy M. 12 years ago

    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

    Alec Kinnear 12 years ago
    Avatar photo

    Hi Jason,

    If you could send us that quick plugin we’d be happy to incorporate that code into a single built-in Amazon solution to simplify your life.

    Thanks!

    Making the web work for you, Alec

    Martin 12 years ago

    Hi Jason and Jeremy,

    thank to both of you for your input.

    Today we worked on adding the Amazon S3 protection support straight in to our plugin but I was not able to replicate your bug yet.

    But I’ll have one more look at Jeremy’s code to figure out what could it be that it’s breaking for you.

    Thanks,
    Martin

    Martin 12 years ago

    Hello Jason and Jeremy,

    we just released version 2.1.24. It includes the fix for passing Amazon S3 signed URLs to the Flash version of the player.

    It was actually a bit trickier, as the correction of %2B needs to happen for Flash only. HTML5 player needs the URL without the fix. We also had to make sure the video checker works with these URLs too. Now we will concentrate on our own implementation of the Amazon S3 signed URLs, which will also work with cache plugins etc.

    Jason, since you already have a license, we added one more domain slot for you.

    Jeremy, we added a thank you note in our change log.

    Thanks,
    Martin

    Anonymous 12 years ago

    Günstige microsoft office 2010 professional Windows 8 Key – Computer und Prozessor. Darüber hinaus müssen alle Dienste im selben Prozess unter dem gleichen Account durchgeführt werden. Vereinfachte 3D-Design in Photoshop Extended, professional 2010 Office OEM 64 Bit. In einigen Fällen in der oberen rechten Ecke des Symbols windows 7 key befindet sich in einem triangle.Some der Ideen scheinen durchaus sinnvoll und vertretbar ist, wie die Ausrichtung des dauerhaften und zuverlässigen Tests angezeigt. Unterstützte Dateisysteme und Geräte, Microsoft Office Professional zu verkaufen 64 Bit. Aus funktionaler windows 7 key kaufen Sicht, erhält der Prozess das gleiche Ergebnis, aber der Charakter-Schnittstelle kann viel schneller laufen. Das Ziel der Forschung war die Entwicklung von internationalen Standards für die Übertragung von Daten aus diesen Arten von Computer networks.As Sie sehen können, kam es gut. Typ Bild an dieser Stelle in der Zeichnung dargestellt. office 2010 key Was ist Photoshop Extended, billig Microsoft Office 2010. Erstellen Sie einen Teilbereich des Snap. Lesen Sie mehr über den geistigen Fortschritt der Lektüre und schnell vvodevyvode wir später erzählen werden.

    Jeremy M. 12 years ago

    Sounds great! Glad I was able to help out.

    – Jeremy

    Martin 12 years ago

    Hello Jason and Jeremy,

    I forgot to add – you really should be using our fix and remove the Jeremy’s hot-fix. Otherwise the Amazon S3 signed URLs won’t work in HTML5 player.

    Thanks,
    Martin

    Jason D. 12 years ago

    Sorry guys … disabled Jeremys’ plugin fix and updated the FV WordPress
    Flowplayer plugin and now the videos won’t load.

    ‘http://www…..com/launch/’

    Martin 12 years ago

    Hello Jason,

    we are sorry about the inconvenience, however –

    I refreshed the page many times and the video always played for me (in HTML5 in Safari and Flash in Firefox and IE 10 and also on iPad).

    I was checking the source code and could see how the fix for %2B works for Flash and not for HTML5, as it’s supposed to. The secured video URL is also visible above the “Benefits of Membership” heading, looks like you left it there for debugging.

    Please let us know if there was some issue which you had to figure out (perhaps to make it works with your Amazon S3 plugin) or if you are still having the issue and in which browser.

    Thanks,
    Martin

    Jason D. 12 years ago

    Hey Martin,

    I should have tested in multiple browsers. You’re right, it works great in
    FF, Opera, Safari and IE … the trouble seems to be with Chrome – at least
    for me.

    Does it work in Chrome for you?

    J

    Martin 12 years ago

    Hello Jason,

    Chrome 21.0.1180.90 on Mac OS X 10.5.8 fails for me sometimes. I mean when I reload it plays, but sometimes it won’t. Same for Chrome 28.0.1500.72 m on Windows 8.

    It happens even with URLs without %2B in them.

    Please try to disable the autobuffering, we had these Chrome issues with some MOV files an disabling autobuffering seemed to help: http://foliovision.com/support/fv-wordpress-flowplayer/troubleshooting/mov-videos#post-1906

    Please let us know, we should disable autobuffering for Chrome when using both MP4 and MOV if it helps.

    Thanks,
    Martin

    Jason D. 12 years ago

    Disabled autobuffer and now the video loads every time in Chrome.

    Thank you very much for working on this. Sincerely, you guys have been wonderful to work with.

    The extra domain slot will come in handy for a dev environment!

    Feel free to reach out if you need any testers/help.

    Jason

    Martin 12 years ago

    Hello Jason,

    thank you for the kind words!

    We will update this thread when our own code to deal with secure Amazon URLs is ready, so you can give it a try.

    We will probably disable autobuffer for Chrome for these secure Amazon URLs. And also MOV files as it was causing issues in other thread (.mov videos?).

    Thanks,
    Martin

    Martin 12 years ago

    Hello Jason,

    we just released version 2.1.32 which has support for Amazon S3 protected URLs.

    You can enter your bucket name and API keys in Settings -> FV WordPress Flowplayer -> Amazon S3 Protected Content box.

    Then just paste the full file URL as a source of the video, like this:

    [fvplayer src="https://s3-eu-west-1.amazonaws.com/flowplayer500600/videos/31-alderbrook-branded-1.mp4"]

    When you save the post, the file is examined and the expire time is set to its length, otherwise the default is 5 minutes.

    If the site visitor comes to the video later that day and tries to play it, it will fail gracefully – telling him that the video expired and he needs to reload the page.

    If you have some time to check this out, that would be great. Now I need to put up a proper documentation for this.

    Thanks,
    Martin

    Jason D. 12 years ago

    Hey Martin,

    I updated the plugin and attempted to add a bucket but I get the following error on the admin screen: Warning: Invalid argument supplied for foreach() in /…/wp-content/plugins/fv-wordpress-flowplayer/view/admin.php on line 82

    And the “Add More Amazon S3 Secure Buckets” button doesn’t appear to do anything.

    When I look at your code, line 76 through 80, $fv_fp->conf[‘amazon_bucket’] is a string so it makes sense that the foreach is having trouble.

    If I manually instantiate the three variables above as arrays, the admin screen shows the way it’s supposed to.

    Great job guys!

    This is fast becoming my most favorite plugin! J

    Looks like the Amazon S3 feature works great so far! Just tested it with a protected file and it seems to work well. I think all you have to do is fix the admin screen issue and you’re golden. I’ll lean on it some more tomorrow and let you know if I find anything else.

    J

    Martin 12 years ago

    Hello Jason,

    sorry about that, it’s really a rookie level mistake. I only tested installing the plugin from scratch and not the upgrading from one of the recent versions.

    It’s fixed now and it will go into new version today.

    We are happy if you like the plugin. If you could check out what happens if you open a post, then wait for an hour (needs to be longer than the video duration or 15minutes – we want to lower it to 5 minutes actually) or so and try to play it, that would be great. You should get a nice message that you need to reload the page.

    Thanks,
    Martin

    Martin 12 years ago

    Hello Jason,

    version 2.1.34 with this fix and couple of others was released.

    Thanks,
    Martin

    Jason D. 12 years ago

    Hi Martin,

    Ran the test. Opened the post, went away for a couple of hours, returned, clicked play and received a message that says, “Video file expired. Please reload the page and play it again.”

    This is an excellent feature as my other setup would result in a message that said something like, “File not found” which I knew would be confusing. I actually had to hack the code in the plugin I was using to generate the signed URLs because I felt I needed to extend the expiry time out to several hours just to reduce the chance that someone might get a message like that and be confused. Now, with your new feature, not only do I have full control over the expiry time through the UI but the user is also given a helpful message in the event the page does expire – perfect!

    Great job guys!!!!

    J

    Martin 12 years ago

    Hello Jason,

    thanks! That’s what we wanted – an intelligent error message if the video has expired.

    Martin

Viewing 22 replies - 1 through 22 (of 22 total)
Reply To: Using Amazon S3 signed URLs



Please Sign in or Register to upload files.

Related Posts

  1. Amazon S3 Signed URLs

    Amazon S3 Signed URLs

  2. Amazon S3 Firmado URLs (English)

    Amazon S3 Firmado URLs (English)

  3. Amazon S3 unterzeichnet URLs

    Amazon S3 unterzeichnet URLs

Primary Sidebar

Sign in Register
FV Player Docs Post New Topic

Welcome

to Foliovision support forums! We'll be happy to provide free support to resolve all the reported bugs. You always can start by specifying your OS and browser and steps to reproduce the bug.

If you need help with the installation on your site, please submit a request for a Pro Support Incident. We'll have you up and running in no time, with detailed instructions on how to resolve your issue yourself in the future.

Facing a hard to solve WordPress problem? On a tight deadline?

Let us take care of it for you
right now.

Pro Support Buy FV Player

Footer

Our Plugins

  • FV WordPress Flowplayer
  • FV Thoughtful Comments
  • FV Simpler SEO
  • FV Antispam
  • FV Gravatar Cache
  • FV Testimonials

Free Tools

  • Pandoc Online
  • Article spinner
  • WordPress Password Finder
  • Delete LinkedIn Account
  • Responsive Design Calculator
Foliovision logo
All materials © 2025 Foliovision s.r.o. | Panská 12 - 81101 Bratislava - Slovakia | info@foliovision.com
  • This Site Uses Cookies
  • Privacy Policy
  • Terms of Service
  • Site Map
  • Contact
  • Tel. ‭+421 2/5292 0086‬

We are using cookies to give you the best experience on our website.

You can find out more about which cookies we are using or switch them off in .

Powered by  GDPR Cookie Compliance
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Necessary Cookies

Strictly Necessary Cookie allow you to log in and download your software or post to forums.

We use the WordPress login cookie and the session cookie.

If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.

Support Cookies

Foliovision.com uses self-hosted Rocket.chat and self-hosted Freescout support desk to provide support for FV Player users. These cookies allow our visitors to chat with us and/or submit support tickets.

We are delighted to recommend self-hosted Rocket.chat and especially Freescout to other privacy-conscious independent publishers who would prefer to self-host support.

Please enable Strictly Necessary Cookies first so that we can save your preferences!

3rd Party Cookies

This website uses Google Analytics and Statcounter to collect anonymous information such as the number of visitors to the site, and the most popular pages.

Keeping this cookie enabled helps us to improve our website.

We reluctantly use Google Analytics as it helps us to test FV Player against popular Google Analytics features. Feel free to turn off these cookies if they make you feel uncomfortable.

Statcounter is an independent Irish stats service which we have been using since the beginning of recorded time, sixteen years ago.

Please enable Strictly Necessary Cookies first so that we can save your preferences!