Skip to content

Commit

Permalink
updated manifesto
Browse files Browse the repository at this point in the history
  • Loading branch information
edsilv committed Aug 14, 2018
1 parent 3e7a684 commit bc4b1a4
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"jquery-ui-touch-punch": "0.2.3",
"jsviews": "0.9.83",
"key-codes": "edsilv/key-codes#v0.0.7",
"manifesto.js": "2.2.31",
"manifesto.js": "2.2.32",
"mediaelement": "4.0.2",
"opencollective": "1.0.3",
"openseadragon": "2.2.1",
Expand Down
15 changes: 2 additions & 13 deletions src/extensions/uv-av-extension/dependencies.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
define(function () {
// https://developer.mozilla.org/en-US/Apps/Fundamentals/Audio_and_video_delivery/Live_streaming_web_audio_and_video
// Dash is supported everywhere except safari
function isSafari() {
// https://stackoverflow.com/questions/7944460/detect-safari-browser?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
//console.log('isSafari', isSafari);
return isSafari;
}
function isAdaptiveStreamingAvailable() {
var isAvailable = !!(window.MediaSource || window.WebKitMediaSource);
//console.log('isAdaptiveStreamingAvailable', isAvailable);
return isAvailable;
}
function isFormatAvailable(formats, format) {
var isAvailable = formats.includes(format);
//console.log('isFormatAvailable', format, isAvailable);
return isAvailable;
}
function isHLSAvailable(formats) {
Expand All @@ -27,30 +21,25 @@ define(function () {
var alwaysRequired = ['iiif-tree-component', 'iiif-av-component', 'iiif-metadata-component', 'jquery-ui.min', 'jquery.ui.touch-punch.min', 'waveform-data'];
if (isAdaptiveStreamingAvailable()) {
if (isMpegDashAvailable(formats) && !isSafari()) {
//console.log('load mpeg dash');
return {
sync: alwaysRequired.push('dash.all.min') // ['dash.all.min'].concat(alwaysRequired)
sync: alwaysRequired.push('dash.all.min')
};
}
else if (isHLSAvailable(formats)) {
//console.log('load HLS');
return {
sync: alwaysRequired.push('hls.min') // ['hls.min'].concat(alwaysRequired)
sync: alwaysRequired.push('hls.min')
};
}
else {
//console.log('adaptive streaming not available');
return {
sync: alwaysRequired
};
}
}
else {
//console.log('adaptive streaming not available');
return {
sync: alwaysRequired
};
}
};
});
//# sourceMappingURL=dependencies.js.map
1 change: 0 additions & 1 deletion src/extensions/uv-default-extension/dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ define(function () {
};
};
});
//# sourceMappingURL=dependencies.js.map
1 change: 0 additions & 1 deletion src/extensions/uv-mediaelement-extension/dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ define(function () {
};
};
});
//# sourceMappingURL=dependencies.js.map
1 change: 0 additions & 1 deletion src/extensions/uv-pdf-extension/dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ define(function () {
};
};
});
//# sourceMappingURL=dependencies.js.map
10 changes: 8 additions & 2 deletions src/extensions/uv-seadragon-extension/DownloadDialogue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,12 @@ export class DownloadDialogue extends BaseDownloadDialogue {
return new Size(Math.floor(imageSize.width * scale), Math.floor(imageSize.height * scale));
}

private _isLevel0(profile: any): boolean {
if (!profile || !profile.length) return false;

return manifesto.Utils.isLevel0ImageProfile(profile[0]);
}

isDownloadOptionAvailable(option: DownloadOption): boolean {

if (!this.extension.resources) {
Expand All @@ -582,9 +588,9 @@ export class DownloadDialogue extends BaseDownloadDialogue {

const canvas: Manifesto.ICanvas = this.extension.helper.getCurrentCanvas();

// if the external resource doesn't have a service descriptor
// if the external resource doesn't have a service descriptor or is level 0
// only allow wholeImageHighRes
if (!canvas.externalResource.hasServiceDescriptor()) {
if (!canvas.externalResource.hasServiceDescriptor() || this._isLevel0(canvas.externalResource.data.profile)) {
if (option === DownloadOption.wholeImageHighRes) {
// if in one-up mode, or in two-up mode with a single page being shown
if (!(<ISeadragonExtension>this.extension).isPagingSettingEnabled() ||
Expand Down
1 change: 0 additions & 1 deletion src/extensions/uv-seadragon-extension/dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ define(function () {
};
};
});
//# sourceMappingURL=dependencies.js.map
3 changes: 0 additions & 3 deletions src/extensions/uv-virtex-extension/dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ define(function () {
return {
sync: ['three.min'],
async: ['VRControls', 'VREffect', 'stats.min', 'OBJLoader', 'MTLLoader', 'PLYLoader', 'GLTFLoader', 'Detector', 'WebVR', 'virtex', 'iiif-metadata-component']
// sync: ['three.min', 'draco_decoder'],
// async: ['VRControls', 'VREffect', 'stats.min', 'DRACOLoader', 'GLTFLoader', 'OBJLoader', 'MTLLoader', 'Detector', 'WebVR', 'virtex', 'iiif-metadata-component']
};
};
});
//# sourceMappingURL=dependencies.js.map
14 changes: 13 additions & 1 deletion src/lib/manifesto.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// manifesto v2.2.31 https://github.com/iiif-commons/manifesto
// manifesto v2.2.32 https://github.com/iiif-commons/manifesto
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.manifesto = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
(function (global){

Expand Down Expand Up @@ -2366,6 +2366,9 @@ var Manifesto;
return Utils.normaliseUrl(url1) === Utils.normaliseUrl(url2);
};
Utils.isImageProfile = function (profile) {
if (typeof (profile) === 'string') {
profile = new Manifesto.ServiceProfile(profile);
}
if (Utils.normalisedUrlsMatch(profile.toString(), Manifesto.ServiceProfile.STANFORDIIIFIMAGECOMPLIANCE0.toString()) ||
Utils.normalisedUrlsMatch(profile.toString(), Manifesto.ServiceProfile.STANFORDIIIFIMAGECOMPLIANCE1.toString()) ||
Utils.normalisedUrlsMatch(profile.toString(), Manifesto.ServiceProfile.STANFORDIIIFIMAGECOMPLIANCE2.toString()) ||
Expand Down Expand Up @@ -2395,6 +2398,9 @@ var Manifesto;
return false;
};
Utils.isLevel0ImageProfile = function (profile) {
if (typeof (profile) === 'string') {
profile = new Manifesto.ServiceProfile(profile);
}
if (Utils.normalisedUrlsMatch(profile.toString(), Manifesto.ServiceProfile.STANFORDIIIFIMAGECOMPLIANCE0.toString()) ||
Utils.normalisedUrlsMatch(profile.toString(), Manifesto.ServiceProfile.STANFORDIIIF1IMAGECOMPLIANCE0.toString()) ||
Utils.normalisedUrlsMatch(profile.toString(), Manifesto.ServiceProfile.STANFORDIIIFIMAGECONFORMANCE0.toString()) ||
Expand All @@ -2408,6 +2414,9 @@ var Manifesto;
return false;
};
Utils.isLevel1ImageProfile = function (profile) {
if (typeof (profile) === 'string') {
profile = new Manifesto.ServiceProfile(profile);
}
if (Utils.normalisedUrlsMatch(profile.toString(), Manifesto.ServiceProfile.STANFORDIIIFIMAGECOMPLIANCE1.toString()) ||
Utils.normalisedUrlsMatch(profile.toString(), Manifesto.ServiceProfile.STANFORDIIIF1IMAGECOMPLIANCE1.toString()) ||
Utils.normalisedUrlsMatch(profile.toString(), Manifesto.ServiceProfile.STANFORDIIIFIMAGECONFORMANCE1.toString()) ||
Expand All @@ -2421,6 +2430,9 @@ var Manifesto;
return false;
};
Utils.isLevel2ImageProfile = function (profile) {
if (typeof (profile) === 'string') {
profile = new Manifesto.ServiceProfile(profile);
}
if (Utils.normalisedUrlsMatch(profile.toString(), Manifesto.ServiceProfile.STANFORDIIIFIMAGECOMPLIANCE2.toString()) ||
Utils.normalisedUrlsMatch(profile.toString(), Manifesto.ServiceProfile.STANFORDIIIF1IMAGECOMPLIANCE2.toString()) ||
Utils.normalisedUrlsMatch(profile.toString(), Manifesto.ServiceProfile.STANFORDIIIFIMAGECONFORMANCE2.toString()) ||
Expand Down
2 changes: 1 addition & 1 deletion src/lib/manifold.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @iiif/manifold v1.2.29 https://github.com/iiif-commons/manifold#readme
// @iiif/manifold v1.2.30 https://github.com/iiif-commons/manifold#readme
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.iiifmanifold = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
(function (global){

Expand Down

0 comments on commit bc4b1a4

Please sign in to comment.