Safari scroll position jumping

I am experiencing an anomaly with a scroll progress indicator I created using React. It works smoothly on chrome however on safari it is jagged. Below is a snippet of what I’m seeing, is this something I can fix?

enter image description here

I tried to disable scroll-snap for safari but that didn’t fix things.

cartPage.js:32 Uncaught TypeError: Cannot read properties of null (reading ‘_id’)

i was trying to make the cart page for my ecommerce website, i passed the product data and quantity correctly in productpage.js.

and in cartpage.js when i try to map and display the fetched data from productpage in a table its showing like this in console “cartPage.js:32 Uncaught TypeError: Cannot read properties of null (reading ‘_id’)”

i think the map is not getting the data, but when i print the data in cart like this “console.log(cart)” it shows all the product details with quantity

i think the map is getting the data as null.
please anybody suggest a change in the code

Cartpage.js

import Layout from "./../components/Layout/Layout";
import { useCart } from '../context/cart';
import { useAuth } from '../context/auth';
import { useNavigate } from 'react-router-dom';

function CartPage() {

    const [cart, setCart] = useCart();
    const [auth, setAuth] = useAuth()
    const navigate = useNavigate()
    console.log(cart)
    
    return (
        <Layout>
            <h1>Hi,{auth?.token && auth?.user.username}</h1>
            <h1>{cart?.length} products in Cart</h1>
            <div>
                <h3>Users</h3>
                <div className='tb'>
                    <table>
                        <thead>
                            <tr>
                                <th>Name</th>
                                <th>Email</th>
                                <th>Orders Placed</th>
                                <th>Date of Sign Up</th>
                            </tr>
                        </thead>
                        <tbody>
                        {cart.length > 0 && cart.map(product => (
                                <tr key={product ._id}>
                                    <td><img src={`http://localhost:3000/uploads/${product .images[0]}`} alt="" style={{ height: "60px" }}></img></td> 
                                    <td>{product .name}</td>
                                    <td>qty</td>
                                    <td>{product .mrp}</td>
                                </tr>
                            ))}
                        </tbody>

                    </table>
                </div>

            </div>
        </Layout>
    )
}

export default CartPage ```

productpage.js

    import React, { useState, useEffect } from "react";
import Layout from './../components/Layout/Layout.js';
import { useParams } from "react-router-dom";
import toast from "react-hot-toast";
import axios from "axios";
import 'bootstrap/dist/css/bootstrap.min.css';
import { Tab, Nav } from 'react-bootstrap';
import Row from 'react-bootstrap/Row';
import Col from 'react-bootstrap/Col';
import "./productpage.css"
import { useCart } from "../context/cart";



const ProductPage = () => {
    const [product, setProducts] = useState([]);
    //const navigate = useNavigate();
    const[cart,setCart]=useCart()
    const params = useParams();
    const [name, setName] = useState("");
    const [description, setDescription] = useState("");
    const [mrp, setMrp] = useState("");
    const [selectedImages, setSelectedImages] = useState([]);
    const[Quantity,setQuantity]=useState(1)


    const getSingleProduct = async () => {
        try {
            const { data } = await axios.get(`/api/v1/product/product-page/${params.id}`);
            setProducts(data);
            setName(data.product.name);
            setDescription(data.product.description);
            setSelectedImages(data.product.images);
            setMrp(data.product.mrp);

            if (data.success) {

            }
        } catch (error) {
            console.log(error);
            toast.error("Something wwent wrong in getting catgeory");
        }
    };

    useEffect(() => {
        getSingleProduct(params.id);
        //eslint-disable-next-line
    }, []);

    return (

        <Layout>
            <div className="pdiv">
                <Row xs={1} md={2} className="g-4 row row-cols-md-2 row-cols-1">
                    <Col className="colone">
                        <img src={`http://localhost:3000/uploads/${selectedImages[0]}`} alt="" style={{ width: "80%" }}></img>
                    </Col>
                    <Col className="coltwo">
                        <h2 className="modln">{name}</h2>
                        <h3 className="mmrp">₹{mrp}.00</h3>
                        <label className="mrlabel">Sales Tax Included</label><br/>
                        <label className="qtylabel">Quantity</label>
                        <input type="number" min={1} defaultValue={1} className="qty" style={{ display: "block" }} value={Quantity} onChange={(e)=>{
                           setQuantity( e.target.value)
                        }} />
                        <button className="addtc" onClick={()=>{
                            setCart([...cart,product,Quantity])
                        }}>Add to Cart</button><br />
                        <button className="buy">Buy Now</button>
                    </Col>

                </Row>
                <Row xs={1} md={2} className="g-4 row row-cols-md-2 row-cols-1">
                    <pre className="descpre">{description}</pre>
                </Row>
            </div>
        </Layout >

    )
}


export default ProductPage

Is there a way I can clone google maps as a library to use on my site that displays locations of multiple moving iot devices?

I am building a website that reads latests locations from a server that logs locations of multiple iot devices moving around the city.
I need to display these locations as pointers on a map.
I have searched and found leaflet and openlayers but they do nott seem accurate as google maps and want to copy the current map for my work.

I have tried libraries like openlayers and leaflet but find they are not as accurate.
Need a way to clone the current version of google maps and import it into a library that allows me to add markers and routs.

Bodymovin & Scrollmagic – pinned content disappears at end of scroll

I am trying to create an on-scroll json lottie animation (canvas) inside of a scrollmagic pin / scene.

Currently, the animation works, but the animation disappears when the “end” indicator reaches the “start” indicator. I can still see the canvas outline, but the content is blank.

I don’t know if the issue lies with the bodymovin script or scrollmagic.

Website is here:
https://ringtree.myshopify.com/

password is: tree

Here is the code I am using. It is more or less copy paste from here:
https://medium.com/johnphungtech/animated-video-scroll-render-for-web-with-bodymovin-scrollmagic-js-9f8de0a494f4

Here is the json file:
https://cdn.shopify.com/s/files/1/0856/7508/2004/files/ringtree_lottie2.json?v=1707564221

const intro = document.querySelector(".intro");

  const controller = new ScrollMagic.Controller();

// set desired animation time long enough so that it doesn't skip frames when scrolling fast.
  const animationTime = 2000;

// initialise scrollmagic scene
  let scene = new ScrollMagic.Scene({
    duration: animationTime,
    triggerElement: intro,
    triggerHook: 0,
  })
    .setPin(intro, {pushFollowers: true})
    .addTo(controller);

// initalise bodymovin

const elem = document.getElementById("lottie");
let anim;

let delay = 0;
let heightPerFrame = 0;

scene.on("update", (e) => {
  heightPerFrame = anim.totalFrames / animationTime; // if total animation duration === total frames, then 1px height scroll = 1 frame moved
  delay = Math.round(e.scrollPos * heightPerFrame);
  anim.goToAndStop(delay, true);

});

scene.addIndicators();


const animateData = {
  container: elem, //
  renderer: "canvas",
  loop: false,
  autoplay: false,
  rendererSettings: { progressiveLoad: false },
  path: "https://cdn.shopify.com/s/files/1/0856/7508/2004/files/ringtree_lottie2.json?v=1707564221", // path to json file
};

anim = lottie.loadAnimation(animateData);

I have checked the json and have made sure that there are no blank frames at the end. I have run the animation through multiple preview tools to confirm that there is no blank frames. I have tried changing more variables than i can remember, including setting “loop” to “true” but no change.

how to get your first job as a junior front-end developer [closed]

I am a front end developer, I worked alone and am self-taught, I want to find a job and have applied for vacancies and have not yet been invited to an interview. What can you do to be invited to an interview for a junior? Can you give me any advice?

I wrote my resume and applied for positions, after which no one invited me for an interview. Can you tell me where is my mistake?

Reseting the position.z of a 3d object inside UseFrame

I am trying to build an 3d animation w/ React and Three.js, where essentially a car starts moving forwards, therefore i decrease the value of it’s z position in the axis using the useRef hook. When it reaches a certain point (f.e. -100) i set the state of the animation to false, the animation stops, but when i try to reset its z position to the initial value,it won’t happen. What i noticed inside my if statement, is that even though i change the state of startCarAnimation value, the value is still true in the console. I tried changing the value by using a useEffect hook with the startCarAnimation as a dependency, but to no aveil.
Here are my Components. The Timer component just sets the startCarAnimation to true after certain events

App.jsx

import React , { Suspense, useState } from 'react';
import { Canvas } from '@react-three/fiber';
import Scene from './Scene';
import Timer from './Timer';

function App() {

  const [startCarAnimation, setStartCarAnimation] = useState(false)
 

  return (
    <main >
      <Timer setStartCarAnimation={setStartCarAnimation}/>
      <Suspense fallback={null}>
          <Canvas shadows>
            <Scene startCarAnimation={startCarAnimation} setStartCarAnimation={setStartCarAnimation} />
          </Canvas>
      </Suspense>
    </main>
  );
}

export default App;

Scene.jsx

import React, { useRef, useState, useEffect } from "react";
import {  PerspectiveCamera } from "@react-three/drei";
import { useFrame,useLoader} from "@react-three/fiber";
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";

export default function Scene({ startCarAnimation, setStartCarAnimation  }) {
  
  const gltf = useLoader(GLTFLoader, '../public/assets/car/scene.gltf')
  const groupRef = useRef();
  const cameraRef = useRef();
  const targetPosition = -100;
  const [zPosition, setZPosition] = useState(0);


  useFrame((state, delta) => {
    if (startCarAnimation) {
        groupRef.current.position.z = zPosition;
        setZPosition((prevScale) => Math.max(prevScale - 2, targetPosition));
        gltf.materials.tyres.map.rotation += 0.1;

        if(targetPosition == zPosition){
          setStartCarAnimation(false)
          setZPosition(0)
          console.log(startCarAnimation)
        }
        
    }
  });

  return (
    <>
      <PerspectiveCamera ref={cameraRef} makeDefault fov={30} position={[0, 0, 0.52]} />
      <group ref={groupRef}  position={[0, -0.9 , 0]} rotation={[0,Math.PI,0]} >
        <directionalLight intensity={8}  position={[0,0,1]}/>
        <ambientLight intensity={3}/>
        <primitive object={gltf.scene} />
      </group>
    </>

  );
}

map.setView is not a function in Vue 2

I am making a leaflet map with geolocation that worked on vue2. Now when I use my code for setView on the leaflet I get the error

"this.map.setView is not a function
TypeError: this.map.setView is not a function
    at eval (webpack-internal:///./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/mapLeafletVue.vue?vue&type=script&lang=js:44:20)"

My Dependencies:

"dependencies": {
    "core-js": "^3.8.3",
    "leaflet": "^1.9.4",
    "vue": "^2.6.14",
    "vue2-leaflet": "^2.7.1",
    "vuetify": "^2.6.0"
  },

My Codes:

<template>
  <v-app>
  
    <v-main>
      <!-- <v-btn color="blue" @click="getlocation()" class="ma-9">get location</v-btn> -->
      <v-card class="ma-10 d-flex flex-column align-center pa-5">
        <v-card-title primary-title>
          your location
        </v-card-title>
        
      <v-card-text>
         <p>lat: {{lat}} <span class="ml-4">lng: {{lng}}</span> </p>
      </v-card-text> 
        <div class="mx-9">
          <div id="mapContainer" style="width:300px;height:300px"></div>
        </div>
      </v-card>
      
    </v-main>
  </v-app>
</template>

<script>

import L from 'leaflet'
export default {
  name: 'App',

  data: () => ({
      lat :0,
      lng :0,
      map:'',
      mapContainer:''
  }),
  mounted(){
    this.getlocation()
    this.map = L.map('mapContainer').setView([51.505, -0.09], 13);
    L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
    maxZoom: 17,
    attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(this.map);
  },

    methods:{
      getlocation(){
       if( navigator.geolocation){
       navigator.geolocation.watchPosition((position)=>{
        this.lat= position.coords.latitude
        this.lng= position.coords.longitude
        this.map.setView([this.lat , this.lng],14)

  L.marker([this.lat,this.lng]).addTo(this.map)
        .bindPopup(`<b>this is your location.</b><br>${this.lat} | ${this.lng}`)
        
    })
       }
    }
  },
};
</script>

get all of messages in discord channel using discord api

hi im working on discord api
and for one section need to get all messages from channel

problem discord api limit : discord have limit to get messages return just 100 message

for give more messages need before query and id
im 80 % pass this limitaion but code need imporove

discord api doc

import axios from "axios";



const api = axios.create({
    baseURL:"https://discord.com/api/v9/",
    headers:{
        Authorization:"xxxx-xxxx--xxxx"
    }
});
let contents = [];

async function getContent (query="limit=100"):Promise<[]> {
    try {
        const content = await api.get(`/channels/111654654546541585/messages?${query}`);
        return content.data;
        
    } catch (error) {
        throw "[ERROR] - Request error from axios";
    }
    
}


function scrapData(slice:[], cbf:()=>void){
    if (slice.length == 0) {
        cbf();
        return;
    }
    slice.map(async (content:content, index) => {
        contents.push(content.content);
        if(index == slice.length - 1) {
            const newSlice = await getContent(`before=${content.id}&limit=100`);
            setTimeout(()=> scrapData(newSlice, cbf),3000);
        }
    })  
}


getContent().then( (data) => {
    scrapData(data, ()=> {console.log(contents)})
})

INP issue: longer than 200ms (mobile), who can help me resolve it, pls

I noticed ads barely gets on my website despite being approved by google adsense, after many months of checking and all, I recently discover that all the links on my websites via search console says they are poor (poor urls) after checking the Core Web Vitals. Please, who can help me fix.

I have zero knowledge about what to do or how to go about it. I will be grateful if I can get help from this platform. Thank you

I was expecting google ads (nothing less than 5) on each of my web pages, but it keeps showing just one or nothing. I have done everything I can do, but it’s not improving till i found out all my urls were ranked poor by google search console Core Web Vitals

useState not updating the variable [duplicate]

So the login fetch it self works and the backend gives me a succes and my json file with the autherized status and the id i need for later on in the react app the problem now is if i console log the id and autherized var on the first login its not changing its variables instead it console logs me the default setting with 0 and false

   let [autherized,setAutherized] = useState(false);
    let [id,setId] = useState("0");
    let [username,setUsername] = useState("");
    let[password,setPassword] = useState("");

    async function submitLogin(){

        let data={
            username:username, 
            password:password 
        }
        const result = await fetch("http://localhost:5000/login",
                                        {
                                            method:"POST",
                                            headers:
                                            {
                                                "Content-Type": "application/json",        
                                            },
                                            body:JSON.stringify(data),
                                        }).then((response)=>{
                                            return response.json();
                                        }).then((data)=>{
                                         setId(data.id);
                                            setAutherized(data.autherized);
                                            console.log(id);
                                            console.log(autherized);
                                        });
    }

i expected the react app in the fetch request to change the states of the id and autherized status on the first time i click on login

How to auto click a button on page load using a chrome extension

My extension entails an auto-bidding bot that automatically applies orders for me on a freelance website. The extension selects an order and after the order page loads it is supposed to click the take order button but that’s where it shuts off. Here is my manifest file:

{
  "manifest_version": 3,
  "name": "Writerslabs Auto Order",
  "version": "1.0",
  "description": "Auto Order on Writerslabs.com",
  "action": {
    "default_popup": "popup.html"
  }, 
  "host_permissions": ["https://writerslabs.com/*"],
  "content_scripts": [
    {
      "matches": ["https://writerslabs.com/*"],
      "js": ["content.js"]
    }
  ],
  "background": {
    "service_worker": "background.js"
  },
   "permissions": [
    "tabs",
    "activeTab",
    "storage",
    "scripting"
  ]
}

And this is my service worker:

chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
    if (request.func === "navigateToOrders") {
      chrome.tabs.sendMessage(request.tabId, { func: "navigateToOrders" });
    }
  });

  
chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {
    if (changeInfo.status === 'complete') {
        chrome.tabs.sendMessage(tabId, { action: 'runSelectEachOrder' });
    }
});



This is my content script that is supposed to click the button. Where am I going wrong?

chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
  if (request.func === "navigateToOrders") {
    window.location.href = "https://writerslabs.com/orders?page=1&all=1";
  }
});


chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) {
  if (message.action === 'runSelectEachOrder') {
      selectEachOrder();
  }
});

chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) {
  if (message.action === 'pressTakeorderbtn') {
    tkeOrderButton()
  }
});


// Function to take orders
function selectEachOrder() {
  // Select all rows
  const tableOrders = document.querySelectorAll("body > div.wrapper > div > section > div:nth-child(7) > table > tbody > tr");

  if (tableOrders.length > 0) {
    // Check if the first row indicates no orders were found
    const firstRowContent = tableOrders[0].textContent.trim();
    if (firstRowContent !== "No any orders were found.") {
      // Start processing orders
      processOrder(tableOrders, 0);
    } else {
      alert("There are no available orders!");
    }
  } 
  
// Recursive function to process each order
function processOrder(orders, index) {
  // Check if all orders are processed
  if (index >= orders.length) {
    return;
  }

  // Get the order ID
  const orderID = document.querySelector("td.first > div > a");

  if (orderID && orderID.textContent.trim() !== "No any orders were found.") {
    alert("Order ID: " + orderID.textContent);
    
    // Code to take the orders
    orderID.click();

    chrome.scripting.executeScript({
      target: { tabId: tab.id },
      function: takeOrderButtonScript
    });
    function takeOrderButtonScript() {
      // Use a setTimeout to ensure that the content is loaded before trying to interact with it
      setTimeout(function() {
        const takeOrderButton = document.querySelector(".modal-btn.green");
    
        if (takeOrderButton) {
          takeOrderButton.click();
        } else {
          console.error("Take Order button not found on the page.");
        }
      }, 2000); // Adjust the timeout as needed
    }
   
  } else {
    alert("There are no available orders");
    // Process the next order
    processOrder(orders, index + 1);
  }
}

}

Getting a undefined value even though passing INT in react, express, zod

Issue with Passing Integer Values to Backend Server and Zod Validation Error

I’m encountering an issue with passing integer values from a React frontend to a backend server. Despite correctly passing integer values through a POST request, the Zod validation on the backend keeps returning an error stating ‘undefined’. I’m unsure why this validation is failing despite passing the appropriate data.

encountering error

Here’s a snippet of my React frontend component responsible for handling the input and sending the data:

import React, { useState } from 'react';

export function CreateInput() {
    const [name, setName] = useState("");
    const [calorie, setCalorie] = useState("");
    const [protein, setProtein] = useState("");
    const [carbs, setCarbs] = useState("");

    const inputStyle = {
        marginBottom: '10px',
        padding: '8px',
        borderRadius: '5px',
        border: '1px solid #ccc',
        fontSize: '16px',
        width: '250px',
        boxSizing: 'border-box'
    };

    const buttonStyle = {
        padding: '8px 16px',
        borderRadius: '5px',
        backgroundColor: '#4CAF50',
        color: 'white',
        border: 'none',
        cursor: 'pointer',
        fontSize: '16px'
    };

    const containerStyle = {
        textAlign: 'center'
    };

    const handleAddFood = async () => {
        // Validation to ensure fields are not empty
        if (!name || !calorie || !protein || !carbs) {
            alert("Please fill in all fields");
            return;
        }

        // Convert the values to integers
        const calorieInt = parseInt(calorie);
        const proteinInt = parseInt(protein);
        const carbsInt = parseInt(carbs);

        // Check if parsing was successful
        if (isNaN(calorieInt) || isNaN(proteinInt) || isNaN(carbsInt)) {
            alert("Calorie, protein, and carbs must be numbers");
            return;
        }

        const now = new Date();
        const year = now.getFullYear();
        const month = String(now.getMonth() + 1).padStart(2, '0');
        const day = String(now.getDate()).padStart(2, '0');
        const hours = String(now.getHours()).padStart(2, '0');
        const minutes = String(now.getMinutes()).padStart(2, '0');
        const seconds = String(now.getSeconds()).padStart(2, '0');
        
        const formattedDateTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
        
        try {
            const response = await fetch('http://localhost:3000/inputfood', {
                method: "POST",
                headers: {
                    'Content-Type': 'application/json'
                },
                body: JSON.stringify({
                    date: formattedDateTime,
                    eat: {
                        name: name,
                        calorie: calorieInt,
                        protein: proteinInt,
                        carbs: carbsInt,
                    }
                })
            });            
            
            if (!response.ok) {
                throw new Error('Network response was not ok');
            }
            
            const data = await response.json();
            alert("Food Added");
        } catch (error) {
            console.error('Error adding food:', error);
            alert("Failed to add food");
        }
    };

    return (
        <div style={containerStyle}>
            <input style={inputStyle} type="text" placeholder="Input Name" onChange={(e) => setName(e.target.value)} /><br />
            <input style={inputStyle} type="number" placeholder="Input Calorie cal" onChange={(e) => setCalorie(e.target.value)} /><br />
            <input style={inputStyle} type="number" placeholder="Input Protein g" onChange={(e) => setProtein(e.target.value)} /><br />
            <input style={inputStyle} type="number" placeholder="Input Carbs g" onChange={(e) => setCarbs(e.target.value)} /><br />
            <button style={buttonStyle} onClick={handleAddFood}>Add Food</button>
        </div>
    );
}

Could anyone help me understand why the Zod validation on the backend is returning ‘undefined’ despite passing integer values correctly? I’d appreciate any insights or suggestions. Thank you!

Webpack “Invalid configuration object” when using type: “asset/resource”

I am new to webpack, and am trying to use images for the first time, following this tutorial. My ultimate goal is to be able to refer to an image in CSS, something like this: background-image: url("assets/bg.png");

Here is my config.

const path = require("path");

module.exports = {
  mode: "development",
  entry: "./js/main.js",
  output: {
    path: path.resolve(__dirname, "."),
    filename: "public/main.js",
  },
  module: {
    rules: [
      {
        test: /.scss$/,
        use: ["style-loader", "css-loader", "sass-loader"],
      },
      {
        test: /.css$/,
        use: ["style-loader", "css-loader"],
      },
      {
        // This part does not work:
        test: /.(png|svg|jpg|jpeg|gif)$/i,
        type: "asset/resource",
      },
    ],
  },
};

It works without the rule for images, but with it I get the following error when building:

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.

  • configuration.module.rules[2].type should be one of these:
    “javascript/auto” | “javascript/dynamic” | “javascript/esm” | “json” | “webassembly/experimental”
    -> Module type to use for the module

I’m not sure what I’m doing wrong and would really appreciate some tips.

(I’m using Webpack 5.74.0)

ConnectionError: Server certificate CA fingerprint does not match the value configured in caFingerprint

i was trying to connect my nodejs app to an elasticsearch server running on https://localhost:9300 and this error “ConnectionError: Server certificate CA fingerprint does not match the value configured in caFingerprint” shows up continuously, i have provided the necessary credentials such as username, password and http_ca.crt file i also used a ca fingerprint to connect to the server this error shows up when i try the ca fingerprint, and if your wondering why i don’t use the .crt file that also has an error that says “ConnectionError: other side closed – Local: 127.0.0.1:45180, Remote: 127.0.0.1:9300” so it seems like i am out of luck, if anybody has encountered the same problem i would really like your insight.

Here is my JS code
Nodejs application code
and for more detail here is the output of the elasticsearch server when i try to connect
enter image description here

openssl x509 -fingerprint -sha256 -noout -in ./http_ca.crt
i used this command to generate a ca fingerprint, and it didn’t work

i also used another command “openssl s_client -connect lox509 -fingerprint -sha2s_client -connect localhost:9300 -servername localhost -showcerts </dev/null 2>/dev/null | openssl x509 -fingerprint -sha256 -noout -in /dev/stdin” to generate the ca fingerprint but it seems that it had the same result

Read metadata from mkv-file, such as subtitles and audio-tracks (js/ts)

I’m currently experimenting with reading metadata from matroska-files in JS, like subtitles and audio-tracks. Been at it for some time now but everything seem deprecated and not working like intended. I’m pretty new to file-reading and such but I figure there must be a way since the information are in there.

I have a large mkv file 2gb-ish that contains several audio-tracks and subtitle-tracks. How in the world can I change the tracks in a browser, is it even possible? Surely it must be. There are no native method of doind this in <video>-tag. I’m using ReactPlayer and in the docs you can change subtitles, but then you need the subtitles-file (but, the subtitles are inside the file :mind-blown:)

So, anyone have experience with these kind of stuff in nodeJS or just plain JS?

/T

I’ve tried numerous of packages from npm but none of them seem to work like intended. Or i’m just to novice to understand how to use them correctly.