thibauts / node-castv2-client

A Chromecast client based on the new (CASTV2) protocol
MIT License
648 stars 95 forks source link

can't get startTime to work #90

Closed zwhitchcox closed 5 years ago

zwhitchcox commented 5 years ago

I'm trying to offset the start time of the video, but it always start at 0, even when I adjust the startTime in the media list like this

    const mediaList = addresses.map((address, i) => ({
        autoplay : true,
        preloadTime : 1,
        startTime : 1,
        activeTrackIds : [],
        playbackDuration: 1,
        media: {
          contentId: address,
          contentType: "video/mpeg",
          streamType: 'BUFFERED'
        }
    }))

It seems like this should be starting at 1 minute

zwhitchcox commented 5 years ago

I was able to work around this by using seek after the video is queued:

    player.queueLoad(
      mediaList,
      {
        startIndex:0,
        repeatMode: "REPEAT_OFF"
      },
      () => {
        player.seek(time)
      }
    )