ios uiWebView: jplayer plays mp3 in simulator but not on device - ios

I created a simple app in Xcode 6 which wraps a uiWebView object to render the contents of a website. The website includes mp3s which sometime play automatically on load, using jplayer. I've set allowsInlineMediaPlayback = YES and mediaPlaybackRequiresUserAction = NO.
When I run the app through the simulator (xcode 6/iPad2/ios8) the sound plays fine. When I run the app through my iPad (8.1.2) the sound doesn't play, even in the cases where it's triggered by a user action. I've checked the mute button and volume controls. I've also checked the paths to the mp3s for case and it all looks ok.
Any ideas why this is working on the simulator but not the iPad?

Related

Background audio not work with Ionic3 + Videogular2 on iOS

I'm using Videogular2 in an Angular/Cordova/Ionic3 project, where I play mp3 audio live streams. All works good with mp3 and mp4, on browser and iOS simulator.
When the user Lock The Screen in iOS Device I expect that the audio continues to play in a background mode, but on IOS when the user Lock The Screen audio stop to play.
I've tested on XCODE 8 to set 'Capabilities' tab adding 'audio' parameter, I've added cordova-plugin-backgroundaudio to the project without success.
On iOS Simulator it works well, the problem occurs only on iOS Device.
Tested on iPhone 6 & iPad 3.
I'm using:
iOS 10.3.3
XCODE 8.3.3
Ionic 3.12.1
Videogular2 5.4.11
No one else used videogular2 on cordova/ionic?
In iOS app audio won't be playing in background when the device is locked. For that you have to enable the background mode for the app. I had faced the same issue in one of my application (I was using different audio plugin).
In order to enable background mode in iOS you can use below plugin
https://ionicframework.com/docs/native/background-mode/. When you start playing the audio you just need to call backgroundMode.enable() to keep it playing in background. When you leave the audio player page if want you can disable background mode to avoid unnecessarily keeping the background mode on by calling backgroundMode.disable().
Additionally you need to enable the background audio feature in xcode project settings as shown in below link.
https://koenig-media.raywenderlich.com/uploads/2016/09/BM-EnableAudioInBG.png

Video no longer playing in iOS 8 WebbApp standalone mode, anyone found a solution?

This bug looks to be resolved as of iOS 9.
The video plays fine on the desktop evergreen browsers, and in stand alone mode on Android devices.
It even plays nice on the iOS8 safari, but once a user goes and adds it to their home screen, the video no longer plays.
I put up an example here http://bugs.readingplus.com/ios8-video-test/.
If you using iOS8 you can play the video, add the url to your home screen and load it up. You will get the controls, but once you touch play all you get is the first frame.
I put the source of the page on Github, or you can just go to the page and view the source.
Am I missing something, is my markup fubared, is this just a bug, has anyone found a work around?
As of iOS 8.3 the issue is partially resolved. I have verified that the video, in the example, now plays when launched from the "Add to Home Screen" link.
The remaining issue is the audio, it is not being rendered/played.
this is great news, can it be confirmed by others?
I don't want to take the plunge and update to 8.3 until I'm confident video and audio in a homescreen webclip are working in iOS 8.3
Looks like iOS 8.3 fixes this issue. I have a standalone web app that uses an audio element, and it's working as expected now. FINALLY!

Changing video quality based on device using MPMoviePlayer

I used an MPMoviePlayer to play an .mp4 video within my app, which works fine. I tried my app on an Android device using Apportable but the video wasn't playing till I later realized that it was because the video quality was too high for the device. Is it possible to change the video quality (of an .mp4) based on the device running the app using MPMoviePlayer? If yes, how can this be done?
If you simply have one video that plays on iOS and one that plays on Android via Apportable, you could opt to simply have two files of the same name where one file is added to the project and attached to the iOS build target and the other is attached to the Apportable build target.

Can't play video in JWPlayer in IOS 7 app, 6.1 works fine

I'm trying to do something pretty basic here. I can't get JWPlayer to even play in an IOS 7 app. When I run it in the simulator as IOS 6.1 it can play just fine. I started with a much more complicated app but then started over with just a single page application. That single page contains one web view which takes the entire space. I'm loading a URL into the web view. That URL that is being loaded is an external page which contains the player. The player loads just fine. I don't get any errors. However, when trying to click play on IOS 7 nothing happens. Like I said, if I switch the simulator to IOS 6.1, I can click play and it works great.
I'm not trying to autostart the video. I'm not trying to play a flash file (it's an .mp4). I'm using the latest version of JWPlayer 6.8. Did something change in IOS 7 regarding HTML5 video player support?
UPDATE: I tried a web view that had just a tag and was able to play the video successfully in IOS 7.
ANOTHER UPDATE: I just tried the exact same code as an iPad app IOS 7 and it works! What is going on here?

iPad MoviePlayer refuses to play video until device restart

I have a very strange bug in a shipping iPad/iPhone app that I can't fix/track down.
My app plays video in a standard MPMoviePlayerController but with the interface hidden and my own buttons to play and stop.
That works fine but sometimes, after a few times of use, my app refuses to play any further video. This happens only on the iPad (in iOS 3.2.x), on the iPhone (in iOS 4.x) everything works fine all the time. Strangely enough, even after I quit my app, after I start it again it still refuses to play video. It doesn't save the video state, and it does reload the video. Only after I restart the iPad it starts working again.
If my iPad is in a "don't play video" state I can debug my app from Xcode and there isn't anything different other than the fact that the movie doesn't play but stays paused indefinitely.
The loadState property reports as MPMovieLoadStatePlayable, but the playbackState property stays MPMoviePlaybackStatePaused however many times I sent it a "play" command.
There is nothing I can do in my app (like choosing another video) to make the video work again.
The videos are 600 x 400 H.264 and are played in a view that is larger than full screen so I can show them full screen (without black bars) on the iPad without needing two different versions for iphone/ipad, because the devices have different aspect ratios.
There is plenty of RAM available (> 60 MB). Other apps that play video (iTunes/YouTube/streamToMe) play fine, but use the standard MoviePlayer interface/controls and don't of course don't play bigger than full screen.
This all makes me suspect this is an Apple bug. I haven't yet tested this in a beta version of iOS, and if so I couldn't talk about it either.
Anybody seen this behaviour? And has a possible solution? Thanks!
In this thread Ipad MPMovieplayerController video loads but automatically pauses when played it appears they solved the issue by using player.useApplicationAudioSession = NO;. Give it a try!
This is a quite common bug with MPMoviePlayerController on iPad OS 3.2.x
After a few runs of any app, the movies fail to play and if you move the scrubber you can see the frames but you can't still play the video for more than one frame at a time!
Besides you may notice a great memory consumption, due to the fact that some apps start receiving memory warnings more often than normal.
Finally you may prove this is a system problem (and not specifically an app problem) buy trying to run other apps that use the same framework, e.g. "ABC News". The issues cannot be seen with other apps that use UIWebView for instance (e.g. the ones based on You Tube videos).
The only solution is to re-boot the device. This works until next reboot.
Carlo

Resources