MPMovieplayerController show blackscreen when app enter foreground from background - background

I have seen the same question but not have the right solution, so I decided to post my own problem.
I'm using an MPMoviePlayerController for playing video in iOS app. I can make it to play in background within my app or even when user tap on Home button (play in background).
The problem is when MPMoviePlayerController is playing, press home button on iPhone, make the app enter
background. Then tap the app's icon to make the app enter foreground, the MPMoviePlayerController's view will be black screen, audio still continue, only video screen cannot see anything.
This is NOT happen if in background, MPMoviePlayerController play the next video, when come foreground from background it works perfectly. And it also not happen in iOS6 or before.
So in inclusion the problem occurred when play the itself video in iOS7
How to make the MPMoviePlayerController's video shows immediately when app came to foreground?
Many thanks for any help!

Related

Using MediaElement in Windows Phone 8.1 app

I'm developing a Windows Phone 8.1 app that plays a video using the MediaElement control. I'm facing some problems for which I've not been able to find information. I've uploaded an example app here: https://mega.co.nz/#!s9sFiQDK!JDI9ar8qWqWIZ_Ot-Q8K8X0qfQ5YG7ATLAiHypOs5Ow
If a click the button in the default page, the app navigates to a second page that contains a MediaElement to play a video. My app is configured to be Portrait only, but I want the video to be displayed in Landscape. For this, I'm changing the screen orientation when clicking on the button and before navigating to the video page with this line: Windows.Graphics.Display.DisplayInformation.AutoRotationPreferences = Windows.Graphics.Display.DisplayOrientations.Landscape; The problem with this is that I can see in the app when the orientation is changing which looks ugly. How can I do to make the video display in landscape without having to change the orientation of the screen? I've seen in the Facebook app that when a video opens, the app does navigate to another page (or at least it seems so from the transition animation that I see) but even though, videos open and play in landscape, there is no screen rotation.
I want to hide the StatusBar before the page with the video is displayed. I've put this line statusBar.HideAsync(); in various places but regardless, I always see that the StatusBar is still hiding when the video is already visible and playing. Again, the Facebook app does hide the StatusBar before the video is shown in the screen.
When the video is playing, if I press and hold the back hardware button, the app is minimized. Now, if I click on its screenshot to go back to it, the app comes to the foreground, but the video is not playing anymore. If I tap on the video to see the video controls, I can see that the video progress line is moving, but the video is like frozen. If I pause the video and play it again, the video resumes. How do I do to make the video to continue to play when the app comes to the foreground? In the Facebook app when I do this, the app comes to the foreground, but the video page is closed and the app takes me to the timeline page. Is this the only way of doing it? If so, how do I detect that when the app comes to the foreground there is a video playing so I can close the page and navigate to the previous one.
If you always want the video page in landscape mode, you can call
Windows.Graphics.Display.DisplayInformation.AutoRotationPreferences = Windows.Graphics.Display.DisplayOrientations.Landscape;
in the page constructor, after InitializeComponent();
Calling
StatusBar.GetForCurrentView().HideAsync();
in the main page constructor is working fine for me.
I still have the same problem, I've tried different approaches, but I can't even get App.Resuming event (and unfortunately in Windows Phone 8.1 WinRT OnNavigatedTo is not triggered on app resuming).

how to keep ios app using opentok video chat in foreground

I've integrated opentok ios sdk in my iOS 7 app, it is working fine, except this problem:
During video chat if I don't access iPhone for 5-10 seconds..then my app moves into background, causing viewer at other end to hear only audio. Video is disabled after app goes to background state.
I've observed same thing with their official example
https://github.com/opentok/opentok-ios-sdk/tree/master/samples/OpenTokFullTutorial
How can I avoid my app going to background while video chat is ongoing. Skype is working fine in this case, I want to achieve same thing.
What you want to do is prevent the iPhone from going to sleep. To do this, you cant try this:
[UIApplication sharedApplication].idleTimerDisabled = YES;
Here is iOS documentation on idleTimerDisabled
If you don't want the app going into background at all (like when the user taps on home button), you can opt to kill the app when it's not running instead of having it run in the background. To do that, check out iOS guide on opting out of background execution
If you do not want your app to run in the background at all, you can
explicitly opt out of background by adding the
UIApplicationExitsOnSuspend key (with the value YES) to your app’s
Info.plist file. When an app opts out, it cycles between the
not-running, inactive, and active states and never enters the
background or suspended states. When the user presses the Home button
to quit the app, the applicationWillTerminate: method of the app
delegate is called and the app has approximately 5 seconds to clean up
and exit before it is terminated and moved back to the not-running
state.
Hope that helped!

can I run movie player in background when mirroring to external screen - objective c

I have an application that plays video from local disk and when a second screen is connected (through AV composite cable) it switch the movie view to the external screen. this is working fine so far. what I want is, when the user press the home button and the app goes to background mode; I want to continue playing the video in the second screen while the app is running in the background mode. this works for audio, as I have set my application to continue play audio in background mode and it is working fine: the audio continue to play in the background mode fine. now is it possible to continue play video as well, and how?
This is not possible. It is outside of the scope of an iOS app to continue powering a screen while it is in the background.

Lock screen wallpaper without audio playing in background iphone

I am working on application in which i have to change the lock screen wallpaper without playing audio in background through application programmatically. I have done with audio in background but is there any way i can do through application. There is an app on appstore here is the link https://itunes.apple.com/us/app/sticky-notes-hd-with-bump/id364874025?mt=8 I dont know how it is possible.
Thanks.

Play video as background in iPad App

I have an app and it has a static uimage as the background. To dress up the app, I have a video that would be great as the background but I cannot find any examples of how to play a video as a background view. I have looked at MPMoviePlayerController but I am not sure if it would do what I am expecting.
Anyone have any ideas, or an example of a video as a background to an app?
Thanks
I guess you could just use the MPMoviePlayerController, if you don't do it fullscreen (which is not possible on the iPhone, but it is so on the iPad).
Then you can just put buttons, labels whatever you want on top of that.
Should work fine :)