Search code examples
ionic4seektotime

How to implement the seekto functionality in ionic 4?


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


Solution

  • 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.