How to detect that youtube has finished to play on iphone? - iphone

How to detect that youtube has finished to play on iphone ? I can't see how since youtube plays in another app or web safari.
But I have seen some apps that can play youtube video one after another so it should be but then how ?

If you're talking about integrating a movie into your app, (which I believe you'd do by loading the video URI into MPMoviePlayerController), you'd listen for MPMoviePlayerPlaybackDidFinishNotification. If you clarify your question though, I may know another method.

Related

Apple watch video playback

Can apple watch capable of video playback? I want to develop an app similar to vine for apple watch. So, user can consume video conveniently from the watch. Is it possible?
I have played with animating multiple images to create a video but it really is a bad approach. Anyone else comes up with any idea?
Update after WWDC 2015:
Good news! Now it's possible!
Link to sample code:
https://developer.apple.com/library/prerelease/watchos/samplecode/WatchKitMoviePlayer/Introduction/Intro.html
Summary:
Now there is a class (WKInterfaceMovie) that allows you to play videos on the watch :)
From the docs:
A WKInterfaceMovie object lets you play back video and audio content
directly from your interface. A movie object displays a poster image
with a play button on top of it. When the user taps the play button,
WatchKit plays the movie in a modal interface.
Class Reference:
https://developer.apple.com/library/prerelease/watchos/documentation/WatchKit/Reference/WKInterfaceMovie_class/index.html
Using the current APIs it might be difficult/impossible.
Still, the camera application on the apple watch is receiving a live stream coming from the camera of the iPhone at a quite good rate.
Most of the apple watch apps are not using only the publicly available APis but it shows that it should be feasible (not talking about the sound here...)
update:
I had missed one feature, there IS an embedded video player with sound on the apple watch... have someone send you a short video has an iMessage and you are able to play it on the watch...

Can a iOS app load a webview with youtube?

I am developing an iOS app. In that I am loading couple of youtube videos using HTML5 using webview.
I am bit concerned about the fact that apple will reject the apps that are loading some big videos directly without HTTP live streaming.
So, is my approach wrong? Shall I load youtube video directly? Is the youtube providing HTTP livestreaming by itself?
I am curious to know these stuffs.
Thanks.
It's fine to load the YouTube video in HTML WebViews. Many apps do it this way.
The key thing to remember is that you are not allowed to autoplay videos, they have to be user initiated i.e. they have to press the play button.
Edit:
Please check this official page

Loading youtube video in my phonegap iphone app

Hi all im trying to load youtube/Dailymotion video using the iframe method in my phonegap app on iphone but everytime i play the video the alert message popsup saying this movie could not be played please help
Have you tried playing a non-commercial video, like a tutorial or something? If that plays you know at least that it is possible to play certain videos. There may be restrictions for playing some videos.

playing an intro video for a website on iphone and ipad

I have been doing some research into what is possible, as far as I can tell
Autoplay
Possible to autostart videos on early versions of IOS http://www.codeblog.co/getting-autoplay-working-on-ios/ although this no longer works on current version (exact version it stopped working I don't know). Behaviour seems to be the same on both the iPad and iPhone?
Playing video in page
On the iPhone videos always pop out to player, its not possible to play in page.
However is possible to play videos in page on the iPad - have tried out the videos on here and they do play inline.
http://www.html5rocks.com/en/tutorials/video/basics/
Playing as intro video
May be able to do an enter now button for the site with below code to trigger
<input type="button" value="Play" onClick="document.myMovie.play()">
https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW10
Could then on iPad make this take the full screen in page in website and use js to detect when the video finishes. Am thinking on iPhone may not be possible to detect when video finishes?
Can anyone clarify what is possible?
As much as I know intro video aren't too popular, this is a requirement for the site.
Automatic play is not possible on iOS as fas sa I'm aware. They removed support on purpose to stop people from doing it.
Any playback now requires the user to actually specify for the video to play, so providing a button to play it should be fine?
Can't you keep your video in the bundle and play it with MPMovieePlayer.Then you won't need to autoplay the video,the video will be played autometically itself.As I do the same thing.

iPhone, how to detect when control is returned to browser?

I'm a newbie to cocoa programing on iPhone.
My client has a website that plays YouTube videos. Once a video is finished playing, it will automatically play the next one. This is done by using the YouTube API and swfobject.
After some research, I was told that Safari on iPhone does not support flash. This make the current swfobject code not working on the iPhone browser.
As workaround, when the user clicked on an embedded player, iPhone will launch the YouTube app.
Is to possible to determine when the YouTube app has finished playing and has returned control back to browser?
You can use UIWebView to play videos from YouTube. You'll have to control those from your application though (start, stop, play next, etc).
Also In iOS you can register custom URI schemes and then redirect the browser (or UIWebView) back to your application. This is how many application do 3-legged OAuth for example (which requires a browser interaction). Which might require having a control over the server.
No, it is not possible to jump out of your App and then come back to it again. Once you leave your App, you are finished.
You'll need to stay in a UIWebView, or come up with another method of playing the YouTube videos from within your App.
-t