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.
Related
I'm playing with the Spotify API in a new component on my VueJS playground, and right now I'm able to control the main application from my web app (just see the current track info, be able to play, pause, skip to next song and to the prevoious one).
The thing is that to display the current information of the current song, I'm doing requests to the playback state endpoint (/me/player) to get all the info. I'm doing it every second unless when the user does an action (play, pause, next...), in that case I force a call to get the current state with all the info.
I think that something like a subscription or an event to detect changes on the player would be so much optimum.
I didn't find something like that on the API Reference. Anyone did a workaround for this?
If you want to see the code of the component, It's available on my GitHub.
Thank you in advance :)
p.s: I'm not used to ask in StackOverflow yet so sorry if I'm missing something.
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.
My video src is an AWS presigned request url, it expires in x amount of time. The video will start playing just fine in video.js. For large video files after the brief url expiration time, changing the seek bar causes a network error because the original src link has expired. How do you refresh the src with another unexpired presigned url without restarting from the beginning of the video? I don't want the video to go back the beginning.
So far I have found that you can capture the change of the seek bar by listening for the event 'timeupdate' and in the passed event testing for e.manuallyTriggered.
Thanks
i had this same issue today. i'm using plyr instead of videojs, so i'm not sure if you can do this exact thing, but my solution was:
bind an error handler to the player for when the link has expired and someone tries to play/seek, and then in the handler...
store the current time of the video
send an ajax request to my server to get an updated signed URL
update the source of the player
set the current time of the video to the previously stored time
it's kind of slow/clunky, but it's the best fix i could come up with at the moment, aside from loading the entire video before allowing playback (which didn't seem like great UX).
update: this does work with videojs...but it doesn't work with either player in Safari, which apparently doesn't send the error event at all.
I have Ionic app that communicates with Laravel API server side. Thing that bothers me is that elements like buttons and pre-defined text show first, and then after a few milliseconds resources from API load.
I would like the whole page to have that same millisecond pause so that all resources load at the same time, because for instance, my POST call breaks if I click the button to place an order before the server resources are shown on screen.
I have no idea how to google that nor what code part would be useful to paste here, so if anyone had simmilar problem...
When using videojs-contrib-ads to create an ad plugin in video.js, the main programme often starts playing before the ads start playing. It seems that video.js connects to the CDN of the main content initially and then contrib-ads checks if it needs to play prerolls. A few seconds of the main content is sometimes played before this happens and only then does it start to play the adverts.
This was seen mostly on iOS on live feeds.
Does anyone know why it works like this and is there a way to stop it?
Use the prerollTimeout setting.
The maximum amount of time to wait for an ad implementation to initiate a postroll, in milliseconds. If contentended has been fired and the ad implementation does not call startLinearAdMode() before postrollTimeout expires, the content video will end playback.