Skip to content

Web Workers can't be initialized with NodeJs #662

@mlhoutel

Description

@mlhoutel

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

While every needed ressources are loaded in the api object, the player is stuck with:

  • _workerIsReady: false
  • _workerIsReadyForPlayback: false

Expected Behavior

The player should be ready for playing, and the track hud (cursor) should be visible.

When launching the player with api.player.play(), the track sound should be audible.

Steps To Reproduce

  1. Initialize a typescript Vue project with Vuetify
  2. Import @coderline/alphatab with npm
  3. Use alphatab with import { AlphaTabApi, Settings } from "@coderline/alphatab
  4. Initialize a new Settings object
    4.1 Set settings.core engine = html5 and useWorkers = true
    4.2 Set settings.player enablePlayer = true and enableCursor = true
    4.3 Link settings.player.scrollElement to an html element
  5. Initialize a new AlphaTabApi with a context and the settings
  6. Load score with api.load(<Bytes buffer>)
  7. Load sound font with api.loadSoundFont(<Bytes buffer>)
  8. Render with api.renderTracks([api.score.tracks[0]])

Link to jsFiddle, CodePen, Project

https://github.com/mlhoutel/Tablatures

Found in Version

1.3-alpha

Platform

Node.js

Environment

- **OS**: Windows 10 
- **Browser**: Chrome 94.0.4606.61
- **Node**: v16.3.0
- **Webpack**: 4.46.0
- **Vue**: 2.6.11
- **Vuetify**: 2.4.0

I tried multiples versions of the npm package **@coderline/alphatab**, from **1.2.0** to **1.3.0-alpha.131**

Anything else?

Reader component: https://github.com/mlhoutel/Tablatures/blob/main/src/components/TabReader.vue
Log of the API object: at https://mlhoutel.github.io/Tablatures then click on the [TRY IMPORTING] button and load a tab file

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions