video.js icon indicating copy to clipboard operation
video.js copied to clipboard

Building videojs with a customized mux.js library?

Open Murmur opened this issue 2 years ago • 3 comments

Description

I was trying to build VideoJS with a customized muxjs library, I failed. See muxjs ticket about my customization, my final version does normal_audio(lang=fin,swe,eng,any)|visual_impaired_audio preference.

$ git clone --depth 1 https://github.com/videojs/video.js.git
$ npx browserslist@latest --update-db
$ npm install
$ npm audit fix
$ npm run build

"mux.js": "https://github.com/Murmur/mux.js/tarball/main"

first try| modified mux.ts in video.js/package.json? file, this did nothing, still dist/video.js had the original muxjs code.

second try| modified mux.ts in video.js/node_modules/@videojs/http-streaming/package.jsonfile and compile a submodule but builing a module fails on missing test content.

$ cd node_modules/@videojs/http-streaming && npm install && npm run build
>> test/**/*.test.js → test/dist/bundle.js...
>> [!] (plugin createTestData) Error: ENOENT: no such file or directory, 
>> scandir '/mnt/c/projects/video.js/video.js/node_modules/@videojs/http-streaming/test/segments'

How do I skip test cases on http-streaming submodule compilation, or this is not how submodule modification should be injected to the overall videojs compilation?

Reduced test case

No response

Steps to reproduce

  1. take videojs from github
  2. modify muxjs library link and compile a project

Errors

error from http-streaming nodemodules library compilation.

test/**/*.test.js → test/dist/bundle.js... [!] (plugin createTestData) Error: ENOENT: no such file or directory, scandir '/mnt/c/projects/video.js/video.js/node_modules/@videojs/http-streaming/test/segments'

What version of Video.js are you using?

latest

Video.js plugins used.

No response

What browser(s) including version(s) does this occur with?

Firefox

What OS(es) and version(s) does this occur with?

Windows 10

Murmur avatar Jul 04 '22 09:07 Murmur

👋 Thanks for opening your first issue here! 👋

If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines.

welcome[bot] avatar Jul 04 '22 09:07 welcome[bot]

Video.js and VHS are compiled at publish time, so the files in dist/ cannot be modified by simply updating dependencies.

You'd probably have to fork VHS (at least), create a custom build of it, and publish it to npm. Then you'd want to use one of the alternate builds of Video.js that does not include VHS baked in.

misteroneill avatar Jul 11 '22 14:07 misteroneill

You can probably build it all locally via npm link, but it's a bit tricky to get right. An alternative is to modify the dist file directly and then use patch-package or something.

gkatsev avatar Jul 11 '22 16:07 gkatsev

This seems to have a resolution. Please feel free to re-open the ticket if that is not the case.

wseymour15 avatar Apr 25 '23 18:04 wseymour15