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

Problems with player in a subdirectory #661

Open
theodortruffer opened this issue Feb 3, 2021 · 3 comments
Open

Problems with player in a subdirectory #661

theodortruffer opened this issue Feb 3, 2021 · 3 comments
Labels

Comments

@theodortruffer
Copy link

theodortruffer commented Feb 3, 2021

Describe the bug

Edit: Please read the first comment, this description is not entirely correct
The player does not work when it's installed in a subdirectory, because a lot of resources seem to be loaded with an absolute path instead of a relative one. We are using the player in our ILIAS-Opencast-plugin and therefore cannot install the player at the base directory.

Various files cannot be loaded; resources, localizations, config and, since version 6.5.0, hls.min.js:

not_found
hls_not_found

The paths should be like this:
http://localhost:8081/Customizing/global/plugins/Repository/RepositoryObject/Opencast/node_modules/paella_player/build/resources/[...]
Because the player is installed at:
/Customizing/global/plugins/Repository/RepositoryObject/Opencast/node_modules/paella_player

Steps to Reproduce

Install the paella player in a subdirectory, like '[web_base_dir]/paella_player_test/' and open it in the web browser.

Workaround (if any)

The problem with the resources directory exists for some time now, but we were able to fix it with a symlink. We just symlinked the resources folder (which is in a plugin subdirectory) to the ILIAS base directory.
Now since version 6.5.0, other folders/files seem to be affected as well, so we would need a lot of symlinks to fix it. So it would be nice to have a fix for this.

Environment Information

  • Browser - all Browsers
  • Paella version 6.5.0

Thanks a lot for your help!

@theodortruffer
Copy link
Author

theodortruffer commented Feb 4, 2021

I have to correct myself, the description above is not exactly right. Also, I found an easy "workaround".

So the scenario in which this bug occurs is this:

  • paella player is installed in some subdirectory, e.g. [web-root]/paellaplayer/build/player
  • the index.html which initializes the player (and includes the scripts) is located at a different subdirectory, e.g. [web-root]/ui/index.html
  • the index.html includes the paella script by absolute paths, so e.g. [web-root]/paellaplayer/build/player/javascript/paella_player_es2015.json

Some resources cannot be loaded in this scenario. For example, it's looking for localization files at [web-root]/localization/paella_en.json, which is the wrong directory.

Edit: This workaround only works for version 6.4.5. With paella 6.5.0, relative paths still produce the above mentioned errors.
Workaround: In index.html, if I load the scripts via relative path instead of an absolute one, so e.g. ../paellaplayer/build/player/javascript/paella_player_es2015.json

So, this is not really an issue for me anymore, since it's easy to solve. Of course it's your decision whether you consider this a bug or want to close the issue.

@theodortruffer
Copy link
Author

Update: I found out that there's a 'folder' variable in the player's config.json. There I can set the paths to profiles, resources and skins. With that configured, the only error messages remaining are wrong paths for localization files, hls.min.js and bootstrap.min.css:

Selection_446

Could the remaining errors be fixed via configuration, or do you think this is an issue.

@theodortruffer
Copy link
Author

Update: I found a workaround. Before loading the player I manually set the variable:
paella.baseUrl = location.href.replace(/[^/]*$/, '') + 'Customizing/global/plugins/Services/Repository/RepositoryObject/OpenCast/node_modules/paellaplayer/build/player/';

The stuff behind the '+' is the relative url where the paella player is installed. The player seems to build the path to hls.min.js, localization and bootstrap based on this url, which (in my case) doesn't represent the actual base url.

This fixes the issue for me. From my point of view, it would be nice to be able to set the baseUrl in the config.json though. But that's just an idea.

srgitlab pushed a commit to fluxapps/OpenCast that referenced this issue Feb 4, 2021
okaufman added a commit to iLUB/OpenCast that referenced this issue Feb 12, 2021
* sr-master: (80 commits)
  changelog
  reformatted code
  changed lang vars
  fixed date format for reports
  Adds "Presenter name mandatory" as a new setting
  Fix Opencast Studio return link for Ilias 5.x
  fixed paella player issue (workaround for polimediaupv/paella#661)
  added testfile for paella livestream
  readme
  remove unnecessary js files for paella player
  changelog
  paella player v6.5.0
  fixed time format for start time
  fixes for page component (own series) & some boyscouting
  static cache for ilias object
  changelog
  paella version 6.4.5 paella#	new file:   node_modules/finalhandler/node_modules/ms/index.js
  changelog
  improvement/fix: new series - disable "choose existing series" if none available
  lang vars
  ...

# Conflicts:
#	classes/Player/class.xoctPlayerGUI.php
#	lang/ilias_de.lang
#	lang/ilias_en.lang
#	node_modules/paellaplayer/build/player/javascript/base.js
#	node_modules/paellaplayer/build/player/javascript/bg2e-es2015.js
#	node_modules/paellaplayer/build/player/javascript/hls.min.js
#	node_modules/paellaplayer/build/player/javascript/lunr.min.js
#	node_modules/paellaplayer/build/player/javascript/paella_player.js
#	node_modules/paellaplayer/build/player/javascript/paella_player_es2015.js
#	node_modules/paellaplayer/build/player/javascript/polyfill.min.js
#	node_modules/paellaplayer/build/player/resources/style/style_dark.css
#	node_modules/paellaplayer/build/player/resources/style/style_dark_small.css
#	node_modules/paellaplayer/build/player/resources/style/style_light.css
#	node_modules/paellaplayer/build/player/resources/style/style_light_small.css
#	node_modules/paellaplayer/package.json
#	templates/paella_player.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant