ffwdme / ffwdme.js

[DEPRECATED!] 🛑 A JavaScript toolkit that aims to bring interactive GPS driving directions to the mobile browser
http://ffwdmejs.org
MIT License
153 stars 36 forks source link

Audio instructions in a web view (ios) #30

Closed OrKoN closed 7 years ago

OrKoN commented 7 years ago

Hello,

I was wondering if audio instructions can work in a web view on iOS? I could not get them working. Any suggestions?

Thanks, Alex

fabrik42 commented 7 years ago

Hi Alex! Sorry, I don't have experience with iOS development. Did you try to create a barebone example without ffwdme, just using the HTML Audio APIs?

Best, Christian

OrKoN commented 7 years ago

@fabrik42 actually I made it work in the meantime. The missing part for me was to include this in AppDelegate.m:

#import <AVFoundation/AVFoundation.h>

  AVAudioSession *audioSession = [AVAudioSession sharedInstance];
  NSError *setCategoryError = nil;
  [audioSession setCategory:AVAudioSessionCategoryPlayback
                      error:&setCategoryError];

in addition to allowing the playback on the WebView component itself. Basically, it works now with audio instructions but it seems it is a bit slower inside a web view compared to a normal mobile browser like Chrome + when you play recorded routes, the marker on the map often jumps back and forth quite often.

fabrik42 commented 7 years ago

Very cool, you made it work!

I am not an iOS developer, but I think it depends on the kind of web view, you are embedding.

However, ffwdme normally does not need very much resources, it should run smoothly in an iPhone 3G Safari. So maybe there some other problem causing the jumpings?