How to set initial position of Picture in Picture? (AVPictureInPictureController / AVPlayerViewController) - swift

For default mode, when user starts Picture-In-Picture, the little windows starts at the latest position (latest pip window closed position).
Is there a way to set starting position like: top-left, top-right, bottom-left, bottom-right?

There is no way to set the starting position of an AVPictureInPictureController.
There isn't really a reason to set the location (it's going to be on top of other apps, not your own), and the user can change the location of it at anytime, out of your control.
From the AVPictureInPictureController documentation:
If an app invokes PiP in a way that is not under the immediate direction of the user, it will be rejected by the App Store.
Also, it is also not suggested to create a subclass of AVPictureInPictureController:
Do not subclass AVPictureInPictureController. Overriding this class’s methods is unsupported and results in undefined behavior.
Creating the functionality of this would require the use of private APIs anyways, and that's a guaranteed rejection by Apple.

Related

Update application placement / Reset origin on Hololens?

Update:
void Awake() {
if(UnityEngine.VR.VRSettings.loadedDeviceName.Equals("HoloLens"))
UnityEngine.VR.InputTracking.Recenter();
}
Doesn't appear to do anything. Found this related post titled, "Reset Hololens Origin" inquiring about a similar behavior. Two individuals affiliated with Unity in someway (both bare the 'Unity technologies' profile tag) brought up InputTracking.Recenter(). One adds, "[S]ome changes landed recently, and part of those changes were hooking up InputTracking.Recenter properly on WindowsMR."
The snippet of code I include above is an attempt to implement this behavior. I most definitely could be trying to call this code in an improper/incorrect location but, as it is now, I do not see it working.
end update
When a user opens a Unity Hololens application they are given control over where the application starts by giving them a generic white box to denote the application and allowed to place it any where via the air tap gesture.
Problem:
If a user blooms out of the application but does not close this white box, the application is left in a suspended or 'tombstoned' state. When the application is opened again, the Hololens remembers the old white box placement and reloads the application their.
This isn't desired behavior as with multiple users and or a variety of locations, the application appears to not be loading to the user when the Hololens is bringing the suspended application back into the running state but not updating its position to current user gaze.
Question:
Can one detect, in awake, where the user is looking and move the application manually?
UnityEngine.WSA.Application.windowActivated : Fired when application window is activated.
Somewhere like this?
Any google searches on this question or variations in wording turn up nothing. Unsure of the possibility of moving the app itself.
If this isn't possible would the next alternative be to force the app to close when I want, say for example, in the suspended state? In an attempt to prevent this type of multiple apps open situation.

google glass camera parameter settings

I'm working on an app that includes a custom camera application on Glass. I want to be able to hard-set different camera parameters, but I'm having difficulty figuring out which ones I actually have access to.
I tried calling parameters.flatten() and got a whole bunch of options that I thought I would be able to use, but when I tried testing them, nothing happened. (For example, when I tried setting the color effect to sepia, the result was still in normal color). Is there any documentation or code I can look at that will tell me which parameter options I actually have?
There are a few open issues on our issue tracker about camera parameters that do not behave as expected:
Issue 302: GDK: Camera effects not registered or take affect
Issue 303: GDK: Request: Additional camera focus modes (with auto focus)
Issue 304: GDK: Camera scene mode does not register or take affect
You may want to follow those so that you can be updated as the GDK evolves.

Corona SDK: scene pushing/popping

I'm a bit confused with Corona scenes.
I'd like to have my main menu (which I dont want released or purged) push to a level when a button is tapped.
So far I can achieve that with storyboard.gotoScene("level1")
However, once level1 is done, I'd like to go back to the mainMenu scene as it were (I use a scrollview whose position I keep). I don't want to recreate mainMenu.
How exactly should I be doing this? Does gotoScene automatically release my existing mainMenu? Thanks
You would simply go to the menu scene using gotoScene("")
Keeping in mind that Corona will auto purge your scenes if it feels that is is needed.
By default, storyboard will automatically purge (e.g. remove the
scene's display group, while leaving the actual module in memory) the
least recently used scene whenever the OS receives a low memory
warning.
If you would like to manage the purging of scenes manually and disable
this auto-purging functionality, you can set
storyboard.disableAutoPurge to true. The default value is false.
To turn off autoPurge:
-- turns "off" auto-purge on low memory functionality
storyboard.disableAutoPurge = true
This will prevent Corona from removing your scenes automatically, which means you are left in charge of this task.

iphone gwtphonegap Geolocation always on

on gwtphonegap 1.7.0.0 (iPhone) i use the geolocation service to get the user's position only once in the beginning on the application
GeolocationOptions options = new GeolocationOptions();
options.setMaximumAge(1000);
options.setEnableHighAccuracy(true);
phoneGap.getGeolocation().getCurrentPosition(callback, options);
the call is made only once in the beginning and no update of the position is needed afterwards.
The problem is that when I run my application on iPhone, the GPS indicator on the status bar stays on all the time, even after I get the correct position.
This may cause a useless battery usage.
Is there a way to tell the Geolocation service to stop after it gets the position?
It seems like we are missing the routines from the gwt phonegap implementation. I just rechecked and they are not part of the docs.
I just posted an issue with the gwt-phonegap project: http://code.google.com/p/gwt-phonegap/issues/detail?id=57
As a workaround you can drop to jsni and call the start / stop method directly.
The underlying phonegap library seems to have start() and stop() methods. You may have to extend gwtphonegap.

iPhone application : is-it possible to use a "double" slider to select a price range

I'm working on an iphone application (not web app) and I'd like to build a form asking a user to indicate a price range. Instead of using two text fields, I would prefer to use a double slider to set the minimum and the maximum price. I know that it is possible de use a simple slider (sound control for exemple) but i've never seen a double one. Can anyone help ?
This is not possible without creating a custom control. You'll need to inherit from UIControl or UIView and provide a custom drawRect method. You'll also need to respond to touch and drag events to update the state of the control. I have not done this myself, but I would be prepared for a fairly significant amount of work to get everything to respond and display as expected.
I'm curious as to why you need to have both values specified on a single slider? Why not use two sliders either side-by-side or stacked? It would not require any more input steps than a double slider, and would conform more to standard UI guidelines.
I think you can specify multiple thumbs for a single slider if you subclass UISlider, at least I vaguely remember that being possible in MacOSX. But Code Addict is right, you'll probably be better off using the standard controls - a double-thumbed slider seems like it'd be pretty difficult to deal with in the touchscreen environment.
I built such a control and added it to GitHub so feel free to have a look and if you like the control extend it and contribute.
GitHub page: http://github.com/doukasd/DoubleSlider
Blog post (showing a video of how it works): http://dev.doukasd.com/2010/08/double-slider/