How to implement the seekto functionality in ionic 4? - ionic4

How can i track till where the user have watched the video in order to resume the video from that position when the user returns?
Like youtube,
it actually knows which video is played till where.
Have checked the AndroidExoPlayer but the only supported platform is Android.
I need in both Android and iOS.
link for AndroidExoPlayer in ionic 4
https://ionicframework.com/docs/native/android-exoplayer/
To check Instance members for AndroidExoPlayer
https://ionicframework.com/docs/v3/native/android-exoplayer/
Have even checked the plugin Media in ionic 4 but it is only for audio
https://ionicframework.com/docs/native/media

Videogular might be a good option.
Here a couple of tips:
vgUpdateTime($currentTime, $duration): Called when progress time has been updated. Returns the current time and the total duration.
seekTime(value, byPercent): Seeks to a specified time position. Param value must be an integer representing the target position in seconds or a percentage. By default seekTime seeks by seconds, if you want to seek by percentage just pass byPercent to true.

Related

react-native-device-info unique ID

Is it safe to use a react-native-device-info unique ID? From what I can understand it will always remain unique for both iOS and android no matter how many times the app will be uninstalled.
If not kindly suggest what else we can use to uniquely identify the device since I want to make sure every user login with a separate device.
const uniqueId = DeviceInfo.getUniqueID();
// iOS: "FCDBD8EF-62FC-4ECB-B2F5-92C9E79AC7F9"
// Android: "dd96dec43fb81c97"
Notes
iOS: This is IDFV so it will change if all apps from the current apps
vendor have been previously uninstalled. android: Prior to Oreo, this
id (ANDROID_ID) will always be the same once you set up your phone.
I was doing SDK for analysts, which generates billions of events every day and I can find the following.
For iOS:
IDFV - changes after user re-install app(if user had only one your app).
I recommend to use next form: currentTimeInMilliseconds_IDFV and save this to KeyChain. KeyChain is updated only after user reset the device to the factory settings.
For Android:
Android don't have a cool version.
I recommend to use form: android.os.Build.SERIAL_Settings.Secure.ANDROID_ID.
Each argument aren't unique and one million devices have about 100 repeats.
But sorry, I don't have example for react native, if you need an example I can search later.

Getting the application or the OS's running time in React Native

Is there a way to get the elapsed running time of an application in React Native?
If possible to get some form of ticks which is not related to the device's time & date.
Pseudo code:
const ticks = Application.getTicks();
console.log(ticks);
While changing the device's date & time will not affect the returned ticks.
I have found the answer on the following Gist.
To utilize it, I've built a simple module that returns the number of seconds since the OS was started.
Here is the Github repository.
The usage is as following:
import RelativeTime from 'react-native-relative-time';
and:
RelativeTime.getRelativeTime()
.then(ticks => console.log(ticks);
It returns the number of seconds since the OS started:
Restarting the Android simulator resets the value returned (as expected)
Restaring the iOS simulator seems to keep the value. Probably means the value which is returned is the Mac's uptime.
Changing the device's time does not change the value returned (as expected)

MobileFirst Geo-trigger "dwellInside" callback not invoked

I am working with the Mobile First Platform studio 7.1 and following the documentation on location services here Documentation. I am doing all my testing with the Mobile Browser Simulator.
I have noticed that while testing with the MBS the callback functions for the sample (DwellInside) are not getting invoked. For example, the app says that an alert will displayed if the location has changed in the last 3 seconds.
I have created a sample application similar)to the one that can be downloaded from the "Documentation" link here:MyCode
My version(which is just gets the locations and does a DwellInside) also cannot get the call back to be invoked.
Is there something that I am missing? Please advise.
To not leave a question unanswered, as mentioned by #user2674117 in the comments:
you will need to pass it new coordinates after startAcquisition. New triggers are evaluated the first time a new coordinate is supplied; it doesn't assume the last given position is necessarily current.

Opening the Camera App in Windows Phone (7 or 8)

Is there a way to launch the camera app programmatically, from my own app? I know that you can use one of the tasks to launch it, allowing the user to take a single photo, but I want the user to be able to take multiple photos. The user could then just hit the back button to go back into the app. I could then track which ones were new by the date/time they were taken.
Jeffrey, you can use CameraCaptureTask class to launch the camera application. More info here
With this class you can take advantage of the camera, to take multiple pictures or something else. You need to manipulate the Completed event.
Hope it helps :)
There is great article here that guides you to the entire process of adding a camera to your app. It even allows you to take multiple images, rename them and saves them to the Camera Roll of your phone.
You could then use the DateTime class to add the date and time of the photo to the photo name (along with the name of your app), thus allowing you to better track the images taken.

Geolocation WatchPosition

I'm doing a system with Geolocation HTML5 and Google Maps API.
I need the position of the user every second to be refresh (because it's sent through websockets to the central computer) so I've used watchPosition and it doesn't refesh the position every time I would like.
If I refresh the entire web page, it changes sometimes the position so I thought that watchPosition it's not working well.
What I can do?
Use it with setTimeout?
Thanks :)
PD: maximunAge is set to 0.
use the setInterval function in javascript which checks for change in position after every interval of seconds specified.