Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

JavaScript BabelJS migrating old project

Ordep-20

Active Coder
Hello again, I'm migrating old project to babelJss since we face a lot of leg of pure js , its very simple we have a videojs we set the source by channel example

channels
{
anime
discovery
news
etc
}

it goes to a endpoint server it return the cdnj url of the channel,

but here comes the problems, most videos isn't live streaming, but all video came with a JSON bundle of chapter markers, and again if the channel seted is anime the makers will be an anime like icon.

I transcript most part of code to BabelJS 6

But I have this code with gives error for no recognized the JQuery(element by class), please I really need help


JavaScript:
 // const video = videojs

video.on("loadedmetadata",function(){
            var total = video.duration();

            var p = jQuery(video.controlBar.progressControl.children_[0].el_);

            for(var i=0;i<markers.length;i++)
            {
                    var left =( markers[i].time/ total * 100)+'%';

                    var time = markers[i].time;

                    var el = jQuery('<div class="vjs-marker" style="left:'+left+'" data-time="'+time+'"><span>'+markers[i].label+'</span></div>');
                    el.click(function(){
                            video.currentTime($(this).data('time'));
                    });
                    p.append(el);             
            }

        });
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom