Is there a way to create an enhanced casting on iOS? - ios

I want to create an enhanced casting on my iOS app.
In simple words, I want to be able to customise the view that's on the screen the user is casting into.
UI for example:
User is watching a video on iOS device.
User clicks on airplay to cast the video to an external device, such as a TV.
Device's screen still showing the video, but on the external device the display contains the video with some customise widgets on it, and a window showing the camera coming from the iOS mobile.
I couldn't find any related information on web, maybe you'll have an idea on what can I do? and what is possible.
Thanks!

Related

Unity ReplayKit how to bypass native preview?

Using the Unity ReplayKit API from https://docs.unity3d.com/550/Documentation/ScriptReference/Apple.ReplayKit.ReplayKit.html
I can record, preview and share screen recordings just fine, however due to design & UX requirements I need to have custom buttons to invoke sharing/saving of the recorded clip. I need to show the recorded clip right after the capture (for example like videotexture on a plane) in the background with custom share button overlays.
Is there a way to access the clip captured by ReplayKit and bypass iOS native preview screen?
With iOS 11, you can have direct access to the video. See https://developer.apple.com/videos/play/wwdc2017/606/
You can save it using AVAssetWriter, then do whatever you want with it after that.
This project doesn't completely work, but will head you in the right direction: https://medium.com/#giridharvc7/replaykit-screen-recording-8ee9a61dd762

Any way to enable user interaction while viewing fullscreen video in iOS browsers?

My research tells me that there is now way to escape fullscreen video viewing in iOS browsers on iPhone or iTouch. It also seems there there is no way to modify the native controls that are displayed along with the video. Is the user in a total blackbox while viewing video in this case?
I'm trying to find someway for a user to indicate that they like a video as it is playing. Is there anything I can do that isn't a hack? If not is there any indication from Apple that they will ever be willing to change this? I'd rather not make an app out of this project.
You actually can play a video in line on an iOS browser, if this is what you are aiming for although there are restrictions - updated answer:
Play video inline in a browser on iOS
Safari on large screen iOS (iPad) should support inline video (I don't have iPAD hand to verify this still works...).
Safari on 'small screen' iOS (i.e. iPhone) will not support inline video as standard. There is at least one workaround which will allow it but this does bypass much of the native video playback performance gains so it may not meet your needs. It is a work in progress still as you will see from the link, but try the demo on an iPhone browser - you need to hit the small play button beside the video, rather than the one on top of the video at the time of writing:
https://github.com/newshorts/InlineVideo
Playing inline in a UIWebView on iOS
Take a look at this Apple Developer page:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIWebView_Class/index.html#//apple_ref/doc/uid/TP40006950-CH3-SW31
In particular:
allowsInlineMediaPlayback
A Boolean value that determines whether HTML5 videos play inline or use the native full-screen controller.
and:
Discussion
The default value on iPhone is NO.
In order for video to play inline, not only does this property need to be set on the view, but the video element in the HTML document must also include the webkit-playsinline attribute.

HTML Recording video on iOS

I'm new to HTML coding, and i'm currently trying to build an app in iOS like snapchat, that will take a users camera and record without stopping if the user goes into the main menu or whatever. I'm looking for some HTML5 code that will allow me to have the main interface just be the back camera output, with buttons that i'll have over the front.
A few searches have led me here: http://www.html5rocks.com/en/tutorials/getusermedia/intro/
Which I have tried to make work but iOS does not support it.
I'm basically asking: How do I make an app record video with it starting on screen?
You could write a web app to do this, but not a native app (i.e. from the App Store). For that, you'll need to learn Objective-C or Swift, then take a look at the AVFoundation framework.

iPad application - Mirroring the app in airplay

I've a kids application which is rich in graphics.
It don't have any videos in it. Only background audio will be there
It has some activities like counting numbers, reading alphabets etc.
Can I mirror the application in apple tv using airplay so that what ever they see on iPad app must be shown on TV also?
I googled a lot... but i couldn't find any code. But I read that its possible. Can some one guide in how to proceed with this feature?
To use AirPlay your application does not necessarily have to do anything special. AirPlay is built-into iOS, and any app or game can take advantage of it. The user simply has to double-tap the Home button, swipe to the left, press the AirPlay button and select the mirroring option. This works for all apps automatically, including video and sound.

Set Airplay manually?

I have an iPad app and I have a video playing in a view. I would like to play video using Airplay but by pressing my own button.
I have set allows airplay = YES and so forth, this works if I enable the full controls, but I want to set no controls and have my own button to play the video using Airplay.
So far, I have found no information that would allow me to play a video on AppleTV without allowing the normal controls.
So just using an UIButton action to force the airplay, or at least get available devices and set it manually. Anything that would allow me to do this.
MPVolumeView will only control audio, it won't control video. For that you'd need iOS 5's AVPlayer, or a movie controller.
An alternative for you might be to use AirplayKit, a 3rd party library.
https://github.com/rothacr/AirplayKit
To answer my own question.
This is quite possible without jailbreak.
Here is apple's own page explaining this, so this will pass the review process.
Apple developer library document explaining how to do this

Resources