# Bitmovin - React JS | Player Gets Stuck in Buffering After Seeking in VOD playback

**URL:** <https://community.bitmovin.com/t/bitmovin-react-js-player-gets-stuck-in-buffering-after-seeking-in-vod-playback/3447>\
**Category:** Support\
**Tags:** bitmovin-player, bitmovin, web\
**Created:** [December 5, 2024, 6:53am UTC](https://community.bitmovin.com/t/bitmovin-react-js-player-gets-stuck-in-buffering-after-seeking-in-vod-playback/3447 "2024-12-05T06:53:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amja.hussain](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@amja.hussain](https://community.bitmovin.com/u/amja.hussain)\
**Post date:** [December 5, 2024, 6:53am UTC](https://community.bitmovin.com/t/bitmovin-react-js-player-gets-stuck-in-buffering-after-seeking-in-vod-playback/3447/1 "2024-12-05T06:53:44Z")

</div>

### Product

Other

### Question

I’m working on a web player where we handle ad logic during seeking. The current implementation is as follows: when a user seeks from one position to another, we first check and handle the ad logic, then update the seek target. After the initial seek, when the player enters the “isPlaying” state, we immediately try to seek to a new position.

However, sometimes the player gets stuck in a buffering state, even though it shows that it is playing. The issue seems to resolve when the user manually seeks to a different position.

Has anyone encountered a similar issue? What could be the potential reasons for this behavior, and how can we prevent the player from getting stuck in buffering after seeking?

// my code logic

```auto

useEffect(()=>{
    player.on(PlayerEvent.Playing, (event) => {
      if(event.issuer=="ui-seek" && forcedSeekResetRef.current && event.time!=forcedSeekValRef.current){
   
        setTimeout(function () {
        
          player.seek(forcedSeekValRef.current);
        },800)
      }
    })

    player.on(PlayerEvent.Seek, (seekEvent) => {
    
          if(!forcedPreRollRef.current){
            if(seekEvent.issuer=="ui" && Math.floor(seekEvent.seekTarget)>Math.floor(seekEvent.position) && !forcedSeekResetRef.current){
              let adResData=getAdWithResume(adDataRef.current,seekEvent.seekTarget,'fwd',forcedPreRollRef.current,seekEvent.position,forcedSeekedAdsDataRef.current)

              if(adResData?.forceSeek){
                forcedSeekValRef.current=adResData?.adStartTime;
                forcedSeekEndValRef.current=adResData?.adEndTime+1;
                forcedResumeValRef.current= Math.floor(adResData?.resumeAt);
                forcedSeekResetRef.current=adResData?.resetData;

              }
              
            }
          
          }
    })
  },[])

```

Thanks

---

<div class="post-metadata">

**Author:** ![Kishore](https://sea1.discourse-cdn.com/flex015/user_avatar/community.bitmovin.com/kishore/32/174_2.png) [@Kishore](https://community.bitmovin.com/u/Kishore)\
**Post date:** [January 23, 2025, 7:17am UTC](https://community.bitmovin.com/t/bitmovin-react-js-player-gets-stuck-in-buffering-after-seeking-in-vod-playback/3447/2 "2025-01-23T07:17:17Z")

</div>

Hi @rohan,

Thank you for reaching out. Since you mentioned this issue occurs intermittently, could you check the logs for any errors and share them with us? If possible, please provide logs for both the working and non-working cases with debug enabled so we can compare.

Alternatively, you can share the website link where we can reproduce the issue. Typically, seeking shouldn’t cause the player to get stuck, whether attempted directly or via the API.
