Can't play videos in Vimeo for iOS
I'm unable to play videos in the app. I believe this is due to a known issue with
NSDateFormatter when used to parse/format dates for machine-to-machine communication without setting a locale on the date formatter instance. This affects a number of locales, including the UK (but only when the phone is set to use the 12-hour clock); we see these kind of issues a lot!
Steps to reproduce
Note: you must use a physical iPhone – you can't repro this in the simulator.
- Set your phone's locale to UK: Settings > General > Language and Region, set Region to United Kingdom
- Set your phone to use the 12-hour clock: Settings > General > Date & Time, set 24-Hour Time to OFF
- Open the Vimeo app and attempt to play a video. At this point you'll see an alert saying "Unable to play video. It seems you've set your clock for the future. Fun! Unfortunately, videos won't play normally unless it's reset to your current date and time zone."
- Go to Settings > General > Date & Time, set 24-hour clock to ON
- Kill the Vimeo app then restart it.
- Try to play a video. Note that videos now play correctly.
The problem is that you're using an NSDateFormatter to parse/format dates without specifying the locale to which you expect the serialised dates to adhere. You need to do this:
NSDateFormatter *df = [NSDateFormatter new]; // This is what you're missing: df.locale = [NSLocale localeWithLocaleIdentifier:@"en_US_POSIX"]; // Now do stuff with df.
See https://developer.apple.com/library/ios/qa/qa1480/_index.html for more on this one.
As an aside: I tried to report this in the Vimeo app via "Settings > Support > I think I found a bug in the iOS app", but the "contact us" link leads to a webview where I'm not logged into Vimeo, so I gave up. It would be good to automagically log the user in at that point, as long as they're already logged in in the app.