iPad embedded YouTube video player stays in fullscreen after stopping it programatically - ipad

I have a UIWebView that loads a YouTube video.
The problem is, that if the video is playing in full screen and I reload the web view to "about:blank" to stop the video, the video player remains as the top view in the window's view hierarchy and blocks everything.
Only the black video player remains visible.
Has someone encountered this issue?
Thanks.

I have the same problem.
Using the old embed code ( http://iphoneincubator.com/blog/audio-video/how-to-play-youtube-videos-within-an-application) causes this problem for me. Similarly, the video does not rotate into landscape mode.
I've switched over to the beta code at http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html. Seems to work.
The inability to switch to landscape during playback is still there though.

Related

Swift - After performing AVAssetExportSession, if I hit the home button and reopen the app, the video disappears from my AVPlayer and it goes black

If I wait a few seconds and close/reopen the app (or scroll the video), the video eventually comes back. I am completely lost as to why the video just disappears and my AVPlayer goes black.
Has anyone encountered this and/or know of a fix?
Edit: I set up the AVPlayer inside an AVPlayerLayer like so: https://codeshare.io/vmBHX

Using the 'YouTube-Player-iOS-Helper', is it possible to not pause playback when removing the YTPlayerView from the screen?

I am developing a music app that plays audio, regular video (such as mp4) and youtube videos. It has the proper background mode enabled, as the app plays audio and regular video correctly in the background.
The following issue appears only on the iPad, not on the iPhone.
Using the YouTube-Player-iOS-Helper on iOS 8, adding the youtube video content (YTPlayerView) to another view (as a subview) works great, even when playing. However, removing that YTPlayerView from its superview automatically pauses the playback, which isn't always the desired case (sending the app to the background causes the same effect).
Is it possible to change that behaviour?
I can rationalize manually resuming the playback when the app goes to the background, however, doing the same for the 'remove from superview scenario' causes the playback to stutter for a moment.
The issue can easily be reproduced with the sample app for 'YouTube-Player-iOS-Helper', by playing a video and then changing between tabs. On the iPhone, the player does NOT pause, but on the iPad, the player DOES pause.
If it's impossible, is there other Youtube SDKs that allow this behaviour and still adhere to the official terms and conditions?
Thanks
Figured this one.
The YTPlayerView will NOT pause, on iPad or iPhone, if you remove it from its superview and immediately add it to a view again (can be a different view). That view must be inside a view controller properly rooted in the view hierarchy (not detached).

UIViewController's view has weird 20px

Hello Guys I am facing a wierd behaviour in my app the case is like this :
From view controller(A) present another view controller (B) which has a UIWebView that will open an URL, but sometime the URL is Video link,
Sot he video starts playing in full screen and when finish and tap on Done (Dismiss Video player) and then dismiss the Controller (B) a weird 20px appeared at the bottom of view controller(A) and the whole app will lose the 20px in all screens.
Any one has idea for what is happening, I am certain sure that it caused by playing video through UIWebView
Update 1 :
I just figured out that this could be related to the iOS itself when playing videos whether from video file or from video url (since both will be played using the same player).
My experiment was on Facebook app when I post the same links used in my app inside Facebook app then try to play the videos from the links and the behaviour showed !
I wish if could someone help to confirm if playing videos causing problems on the UI.

MPMoviePlayerController dismissing full screen mode not working in iOS 6

The MPMoviePlayerController working fine in iPad with iOS 5, initially the video starts by adding MPMoviePlayerController to subview of self at certain frame .Pressing full screen button on MPMoviePlayerController embedded controls displaying the movie in full screen,again tapping the button will bring the video back to the initial frame in iOS 5. But in iOS 6, the when I press full screen button to bring the video to initial frame, the video just gone out of screen. Looks like Apple has made some undocumented change to MPMoviePlayer class that is causing this weird behaviour. Anyone having the fix for this?
I have fixed this issue myself, in iOS 6, apple has made some undocumented changes to MPMoviePLayerController class, when you tap on full screen button, the viewWillDisappear and viewDidDisAppear gets called for both the controller launching MPMoviePLayerController and its ParentController.
In My Project (a pdf reader), I have a very complex view hierarchy, adding a reader in view Controller, then adding the readerPageContents buttons(image Gallery, video, link) to reader page and then playing video on video button tap.So it was calling the ViewWillDisappear and ViewDidDisappear when launching the video in full screen, and when when I press toggle screen button to bring the video to initial frame, the ViewWillAppear and ViewDidAppear of both controllers called again and I was creating the pdf page again in parent's controller viewDidAppear which was removing the video.
So easier fix it to avoid ViewDidDisappear and ViewWillDisappear gets called by setting some BOOL.

Movie Player goes blank with white screen once the movie is completely played

I have a MPMoviePlayer whose controls have been hidden.
I have custom sliders to move the video, back and forth and controls to control the speed as well.
Now whenever it reaches the end I can see a white screen.
app does not crash but I can't see the video.
I tried debugging and realized that moviPlayer instance is still there, but naturalSize is reported to be zero.
rest everything is there, including the contentURL property.
has the player released the video ?
UPDATE:
The bug onbly appears on iOS4 and not on iOS5.
Anyone any idea on what changes have come to movieplayer in the two versions which we might have missed.

Resources