Giter Site home page Giter Site logo

Comments (16)

zhw2590582 avatar zhw2590582 commented on June 19, 2024

Do you need to turn on options: scrollable

from wfplayer.

NinjaCoderDotCom avatar NinjaCoderDotCom commented on June 19, 2024

Using this scrollable option is not making any difference.

from wfplayer.

zhw2590582 avatar zhw2590582 commented on June 19, 2024

I don't quite understand what effect you want, can you briefly describe?

from wfplayer.

NinjaCoderDotCom avatar NinjaCoderDotCom commented on June 19, 2024

Hi, @zhw2590582 Sorry for the delay.

Let me explain it with the help of screen recordings of your wfplayer and subplayer libraries.

Wfplayer
https://user-images.githubusercontent.com/107407402/194236952-3302ce45-7886-4975-ba92-73928cc04189.mp4

Subplayer
https://user-images.githubusercontent.com/107407402/194237327-6ffb4026-620d-4f12-9ba9-1472953e2aae.mp4

As you can see, the scrolling of waveform is smooth in subplayer as compared to wfplayer. In subplayer, the waveform scrolls as the seeker scrolls, while in wfplayer, the waveform jumps at the interval of 10 seconds (0 to 10, then 10 to 20, then 20 to 30, and so on). So, what I am asking is how can we do the same smooth scrolling (as done in subplayer) in wfplayer?

from wfplayer.

zhw2590582 avatar zhw2590582 commented on June 19, 2024

I just turned on this option

var wf = new WFPlayer({
    // Mount the audio waveform of the dom
    container: '#waveform',

    // Whether to use scroll mode
    scrollable: true,
})

WX20221007-091835@2x

from wfplayer.

NinjaCoderDotCom avatar NinjaCoderDotCom commented on June 19, 2024

Thanks. Yes, I enabled this setting, and now the waveform on wfplayer.org scrolls as I prefer. Does this attribute also depend on other attributes? Because despite the fact that I passed this information to my code, the waveform does not scroll. Let me also add the code segment.

this.wf = new WFPlayer({
         container: this.$waveform.current,
         mediaElement: document.querySelector('#video'),
         waveColor: 'rgba(255, 235, 59, 0.95)',
         progressColor: 'rgba(255, 255, 255, 0.3)',
         cors: true,
         scrollable: true
    });

where $waveform is ref attached to waveform div ( ).
Do you see anything that might be causing the scrollable attribute not to work?

from wfplayer.

zhw2590582 avatar zhw2590582 commented on June 19, 2024

I wrote a react demo for you:
https://codesandbox.io/s/zealous-bouman-ilouot?file=/src/App.js

from wfplayer.

NinjaCoderDotCom avatar NinjaCoderDotCom commented on June 19, 2024

Hi I saw your demo and tried to change it into class component. Here is the sample code. Feel free to make changes.
https://codesandbox.io/s/class-component-wfplayer-u7otwk

from wfplayer.

zhw2590582 avatar zhw2590582 commented on June 19, 2024

I have modified the code for you
https://codesandbox.io/s/class-component-wfplayer-forked-w5sys7?file=/src/App.js

from wfplayer.

NinjaCoderDotCom avatar NinjaCoderDotCom commented on June 19, 2024

Thanks a lot. I am doing the same in my local code but am not able to see any change. I guess I have to keep checking what segment of code is making the change.

1.) I'd like to know what browser you use because when I open the codesandbox in Google Chrome, the waveform does not appear, whereas the waveform appears fine in Mozilla. Any idea why this is happening?

2.) Can I add the contextmenu on the waveform the same way we are adding it on the subtitle?

from wfplayer.

zhw2590582 avatar zhw2590582 commented on June 19, 2024
  1. You can look at the chrome console, there is a high probability that fetch is wrong when pulling video data, such as cross-domain problems
  2. Yes, do you want to be a subtitle editor? you can refer to this: https://aimu.app

from wfplayer.

NinjaCoderDotCom avatar NinjaCoderDotCom commented on June 19, 2024

Hey, I have attached a screen recording of the subtitle editor you referred to.

aimu.mp4

As you can see in the recording, when I right click on the waveform area (not on the subtitle), the browser's contextmenu is opened. I tried adding a custom contextmenu on the waveform, same as the contextmenu on the subtitle, but no contextmenu event fires when I right click on the waveform. Any suggestions/advice/corrections?

from wfplayer.

zhw2590582 avatar zhw2590582 commented on June 19, 2024

Are you asking how to add a right-click menu?
You can refer to this: https://github.com/vkbansal/react-contextmenu

from wfplayer.

NinjaCoderDotCom avatar NinjaCoderDotCom commented on June 19, 2024

I am not asking how to add a right-click menu. I already have a right-click menu in my project (working fine on the subtitle part) . I just wanted to know if I could add the same right-click menu on my waveform as on the subtitle. I have tried using the same in my project but the right-click menu is not working on the div id="waveform" style="width: 1000px; height: 300px">/div> but it works perfectly on the subtitle over the waveform.

from wfplayer.

zhw2590582 avatar zhw2590582 commented on June 19, 2024

Why not?
https://codesandbox.io/s/zealous-bouman-ilouot?file=/src/App.js

from wfplayer.

NinjaCoderDotCom avatar NinjaCoderDotCom commented on June 19, 2024

I am literally exporting your codesandbox code and running it on my machine and it is behaving differently. Scrollable is not working. ContextMenu is not working. I guess I will have to keep checking why this is happening. Thanks for helping me.

from wfplayer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.