Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video plays from start each time you click on seekbar #347

Open
ijunaid8989 opened this issue Mar 25, 2020 · 1 comment
Open

Video plays from start each time you click on seekbar #347

ijunaid8989 opened this issue Mar 25, 2020 · 1 comment

Comments

@ijunaid8989
Copy link

This is how I am doing it

import "video.js/dist/video-js.css"
import { videoPlayer } from "vue-video-player"


export default {
  name: "Gallery",
  components: {
    videoPlayer
  },

  computed: {
    ...mapGetters(["token"]),
    playerOptions() {
      let url = ""
      switch (this.archive.type) {
        case "clip":
          url = `${process.env.API_URL}/cameras/${this.archive.camera_id}/archives/${this.archive.id}.mp4?authorization=${this.token}`
          break
        case "compare":
          url = `${process.env.API_URL}/cameras/${this.archive.camera_id}/compares/${this.archive.id}.mp4?authorization=${this.token}`
          break
        case "timelapse":
          url = `${process.env.API_URL}/cameras/${this.archive.camera_id}/timelapse/${this.archive.id}/play?authorization=${this.token}`
          break
      }
      return {
        height: "360",
        muted: false,
        autoplay: true,
        loop: true,
        preload: "auto",
        fluid: true,
        language: "en",
        sources: [
          {
            type: "video/mp4",
            src: url
          }
        ]
      }
    },

and in main file.

          <video-player
            v-else
            ref="videoPlayer"
            :playsinline="true"
            class="video-player-box vjs-custom-skin"
            :options="playerOptions"
          />

I am having 2 issues:

If during video play, I click anywhere on seek bar, the video starts from the beginning..
And also it doesn't buffer the video, can you tell me where I am doing things wrong?

@samul-1
Copy link

samul-1 commented Oct 31, 2023

Same issue here. It appears to depend on the backend, but I haven't been able to exactly determine what makes it work with one backend and not with another one. It seems to have something to do with the ability to stream videos from the backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants