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

fix: add logic to use hls for Apple/iOS browsers and dash video for other operating system browsers #57

Merged
merged 5 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 39 additions & 42 deletions cypress/integration/audio.spec.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,39 @@
describe('An audio object', () => {
const URL_PARAMETERS = '#?manifest=https%3A%2F%2Fiiif.library.ucla.edu%2Fark%253A%252F21198%252Fzz002dw04s%2Fmanifest';

it('loads Universal Viewer in an iframe', () => {
cy.visit('/' + URL_PARAMETERS)

// UV loads inside an iframe
cy.frameLoaded("#universalviewer-iframe", {
url: '/uv3.html' + URL_PARAMETERS,
});
})


it('loads in Universal Viewer!', () => {
cy.visit('/uv3.html' + URL_PARAMETERS)

// Shows track title
cy.contains("Side A").should("exist").should("be.visible")

// Settings Button
cy.get("button.settings").should("exist").should("be.visible")

// left panel is enabled
cy.get(".leftPanel").should("exist").should("be.visible")

// "Print" doesn't exist for audio
cy.contains("Print").should("not.exist")

// "Share" is disabled
cy.get("button.share").should("exist").should("not.be.visible")

// Enter / exit fullcreen view
cy.contains("Full Screen").should("exist").should("be.visible")

// Download is disabled
// cy.contains('Download').should("exist").should('not.be.visible')

// Displays waveform image
cy.get("canvas.waveform").should("exist").should("be.visible")
})
})

describe("An audio object", () => {
const URL_PARAMETERS =
"#?manifest=https%3A%2F%2Fiiif.library.ucla.edu%2Fark%253A%252F21198%252Fzz002dw04s%2Fmanifest";

it("loads Universal Viewer in an iframe", () => {
cy.visit("/" + URL_PARAMETERS);

// UV loads inside an iframe
cy.get("#universalviewer-iframe");
});

it("loads in Universal Viewer!", () => {
cy.visit("/uv3.html" + URL_PARAMETERS);

// Shows track title
cy.contains("Side A").should("exist").should("be.visible");

// Settings Button
cy.get("button.settings").should("exist").should("be.visible");

// left panel is enabled
cy.get(".leftPanel").should("exist").should("be.visible");

// "Print" doesn't exist for audio
cy.contains("Print").should("not.exist");

// "Share" is disabled
cy.get("button.share").should("exist").should("not.be.visible");

// Enter / exit fullcreen view
cy.contains("Full Screen").should("exist").should("be.visible");

// Download is disabled
// cy.contains('Download').should("exist").should('not.be.visible')

// Displays waveform image
cy.get("canvas.waveform").should("exist").should("be.visible");
});
});
26 changes: 17 additions & 9 deletions cypress/integration/video.spec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
describe("A video", () => {
it("loads VideoJS", () => {
cy.visit("/#?manifest=https%3A%2F%2Fiiif.library.ucla.edu%2Fark%253A%252F21198%252Fzz002hdsj2%2Fmanifest")

// Shows track title
cy.get(".vjs-poster").should("exist").should("have.css", "background-image", "url(\"https://static.library.ucla.edu/video_icon.svg\")")
cy.get(".vjs-big-play-button").should("exist").should("exist")
})
})

it("loads VideoJS", () => {
cy.visit(
"/#?manifest=https%3A%2F%2Fiiif.library.ucla.edu%2Fark%253A%252F21198%252Fzz002hdsj2%2Fmanifest"
);

// Shows track title
cy.get(".vjs-poster").should("be.visible");
cy.get(".vjs-poster img")
.should("exist")
.should(
"have.attr",
"src",
"https://static.library.ucla.edu/video_icon.svg"
);
cy.get(".vjs-big-play-button").should("exist").should("exist");
});
});
22 changes: 22 additions & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/// <reference types="cypress" />
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

/**
* @type {Cypress.PluginConfig}
*/
// eslint-disable-next-line no-unused-vars
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
}
Loading
Loading