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

Move JS for IIIF-AV Views #226

Closed
1 of 2 tasks
carrickr opened this issue Sep 14, 2018 · 4 comments
Closed
1 of 2 tasks

Move JS for IIIF-AV Views #226

carrickr opened this issue Sep 14, 2018 · 4 comments
Assignees

Comments

@carrickr
Copy link
Contributor

carrickr commented Sep 14, 2018

Status of gem is current in README: https://github.com/samvera-labs/hyrax-iiif_av/blob/master/README.md

This PR should solve the views in engines issue: rails/webpacker#1694

  • move views to the engine
  • determine if we just move the views and then wait for webpacker to accept the above PR and work, or if we do further action on our own (custom webpacker or other tweak)
@carrickr
Copy link
Contributor Author

Views added to the views branch of the gem. Initial testing found we could import npm packages, but the views themselves were not picked up.

@carrickr
Copy link
Contributor Author

Some instructions on getting this up and running.

  1. Check out the views branch of the gem
  2. Generate the internal_test_app via a rake task. rake ci is good for this since it also runs all the tests and lets you establish everything is green when you start off
  3. cd .internal_test_app
  4. Open up the Gemfile and add the webpacker gem as a dependency
  5. Runbundle install
  6. Run rake hyrax:default_collection_types:create and rake hyrax:default_admin_set:create
  7. Run rake webpacker:install and rake webpacker:install:react
  8. Open up config/role_map.yml and make [email protected] an admin
  9. Bring up the server with rake hydra:server
  10. Go to localhost:3000 and create an account using [email protected] as your username and any password you desire
  11. Create a test collection
  12. Create an AV work in that test collection (use a short video because you'll use ffmpeg on your local box to transcode the video)

In theory if things were working you would then see the iiif-av player on the display page for that work

@cjcolvar
Copy link
Member

Rough Instructions I came up with for using react-rails:
Make sure ffmpeg is installed then enable ffmpeg in config/initializers/hyrax.rb
Restart rails and ingest a work with a video file
Add webpacker and react-rails to your gemfile
gem 'webpacker'
gem 'react-rails'
Now run the installers:
$ bundle install
$ rails webpacker:install # OR (on rails version < 5.0) rake webpacker:install
$ rails webpacker:install:react # OR (on rails version < 5.0) rake webpacker:install:react
$ rails generate react:install
Link the JavaScript pack in Rails view using javascript_pack_tag helper, for example:

<%= javascript_pack_tag 'application' %>
Add dependency:
yarn add react-iiif-media-player
Copy react component over to app/javascript/components from engine
Restart rails and magic!

@cjcolvar
Copy link
Member

Current plan is to automate these steps (or at least most of them) using a rails generator.

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

6 participants