Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not found #71

Open
tigrenok00 opened this issue Jul 24, 2024 · 12 comments
Open

Module not found #71

tigrenok00 opened this issue Jul 24, 2024 · 12 comments

Comments

@tigrenok00
Copy link

Hi!
I'm using angular 17 and have installed the following packages:

  "@mintplayer/file-player": "^17.4.0",
  "@mintplayer/ng-player-provider": "^17.0.0",
  "@mintplayer/ng-video-player": "^17.4.0",

In my app.module I have in providers
provideVideoApis(fileLoader),

import {
  provideVideoApis,
  VideoPlayerComponent,
} from "@mintplayer/ng-video-player";
import { fileLoader } from "@mintplayer/file-player";

I am getting the following build errors:

`./src/app/app.module.ts:28:0-53 - Error: Module not found: Error: Can't resolve '@mintplayer/file-player' in 'C:\Work\XXX\src\app'

./node_modules/@mintplayer/ng-video-player/fesm2022/mintplayer-ng-video-player.mjs:4:0-37 - Error: Module not found: Error: Can't resolve '@mintplayer/player-provider' in 'C:\Work\XXX\node_modules\@mintplayer\ng-video-player\fesm2022'
`

Can you help me please?

@PieterjanDeClippel
Copy link
Member

npx @angular/cli@17 new videotest

@PieterjanDeClippel
Copy link
Member

@tigrenok00 At the moment I'm not yet able to do backport patches. Are you able to upgrade to angular 18? Otherwise I have to modify my setup a bit

@tigrenok00
Copy link
Author

Hi @PieterjanDeClippel , thanks for your reply!
I did the ng18 update and now the imports work great.

The only issue I have now is that inline bindings (like url) do not seem to work (I see the video component element being created without content, it doesn't pick up the url):

<div class="vid-preview" *ngIf="currentFile.videoSrc"> <video-player [autoplay]="false" [url]="currentFile.videoSrc" ></video-player> </div>

It only works with programmatic setUrl (which is not ideal as I need to find the component/s with viewChildren and set the corresponding url, also this way it always does autoPlay, so I have to pause manually with a small setTimeout immediately after)

if (this.isVideo) { this.player1?.setUrl(this.currentFile.videoSrc); }

Do you have an idea why the bindings do not work for me?

Thanks!

@PieterjanDeClippel
Copy link
Member

@tigrenok00 This doesn't seem to work indeed. I'll take a look at it now

@PieterjanDeClippel
Copy link
Member

PieterjanDeClippel commented Jul 28, 2024

The following seems to do the trick, so I'll probably need to wait for something there

@Input() public set url(value: string) {
  setTimeout(() => this.setUrl(value), 0);
}
public setUrl(url: string | null) {
  if (this.player) {
    this.player.url = url;
  } else {
    console.warn('player not ready'); // <-- This is hit when there's no delay
  }
}

@PieterjanDeClippel
Copy link
Member

@tigrenok00 Should be fixed in #73

@tigrenok00
Copy link
Author

@PieterjanDeClippel Thank you, the url input works now! Can you please fix this for the properties of autoPlay, width, height as well? They too don't work in direct binding

@PieterjanDeClippel
Copy link
Member

@tigrenok00 I refactored it like this now. The angular package version 18.2.0 should work now

@tigrenok00
Copy link
Author

@PieterjanDeClippel Thanks, in 18.2.0 it looks like height is working, but autoPlay=false still not respected when setting url like this. Also, I'm getting this error which I don't believe I had before (the player is playing)
main-PUFX6TX4.js:54 ERROR No player found for url

@PieterjanDeClippel
Copy link
Member

Should be fixed now too in @mintplayer/youtube-player version 18.1.2

@tigrenok00
Copy link
Author

@PieterjanDeClippel I am using streamable-player and file-player

@PieterjanDeClippel
Copy link
Member

PieterjanDeClippel commented Aug 2, 2024

@tigrenok00

It seems for streamable (player.js) that the API doesn't emit any events anymore...

image

The autoplay on file-player and wrong error message should be resolved in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants