Giter Site home page Giter Site logo

nextcloud / viewer Goto Github PK

View Code? Open in Web Editor NEW
92.0 14.0 52.0 384.45 MB

๐Ÿ–ผ Simple file viewer with slideshow for media

License: GNU Affero General Public License v3.0

JavaScript 77.66% PHP 0.30% Vue 0.87% SCSS 0.03% TypeScript 1.39% CSS 19.76%
nextcloud nextcloud-app vue vuejs photo-gallery media viewer fileinfo videos photos

viewer's Introduction

Files viewer for nextcloud

Show your latest holiday photos and videos like in the movies. Show a glimpse of your latest novel directly from your nextcloud. Choose the best GIF of your collection thanks to the direct view of your favorites files!

viewer

๐Ÿ“‹ Current support

  • Images
  • Videos

๐Ÿ— Development setup

  1. โ˜ Clone this app into the apps folder of your Nextcloud: git clone https://github.com/nextcloud/viewer.git
  2. ๐Ÿ‘ฉโ€๐Ÿ’ป In the folder of the app, install dependencies with npm ci and build the Javascript with npm run build.
  3. ๐ŸŽ‰ Partytime!

๐Ÿง™ Advanced development stuff

To build the Javascript whenever you make changes, you can also run npm run dev for development builds.

๐Ÿ“ท Running cypress tests

To run e2e cypress tests, execute npm run cypress.

The visual-regression tests require additional care as they depend on installation of fonts in the application. To achieve repeatable results run the tests using npm run cypress:visual-regression. This will build the app with the required fonts and run the tests.

If changes are required to the reference (base) screenshots used by the visual-regression tests, run cypress:update-snapshots and commit the updated screenshots.

API

Add the viewer to your app

In php, on your page, emit the LoadViewer event. Check the documentation/tutorial for more info on this type of page controller sample.

use OCA\Viewer\Event\LoadViewer;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IRequest;

class PageController extends Controller {
	protected $appName;

	/** @var IEventDispatcher */
	private $eventDispatcher;

	public function __construct($appName,
								IRequest $request,
								IEventDispatcher $eventDispatcher) {
		parent::__construct($appName, $request);

		$this->appName = $appName;
		$this->eventDispatcher = $eventDispatcher;
	}

	/**
	 * @NoAdminRequired
	 * @NoCSRFRequired
	 * Render default index template
	 *
	 * @return TemplateResponse
	 */
	public function index(): TemplateResponse {
		$this->eventDispatcher->dispatch(LoadViewer::class, new LoadViewer());
		$response = new TemplateResponse($this->appName, 'main');
		return $response;
	}
}

This will load all the necessary scripts and make the Viewer accessible trough javascript at OCA.Viewer

Open a file

  1. Open a file on WebDAV and let the viewer fetch the folder data
OCA.Viewer.open({path: '/path/to/file.jpg'})
  1. Open a file on WebDAV and provide a list of files
OCA.Viewer.open({
  	path: '/path/to/file.jpg',
  	list: [
  		{
  			basename: 'file.jpg',
  			filename: '/path/to/file.jpg',
  			...
  		},
  		...
  	],
})
// Alternative: pass known file info so it doesn't need to be fetched
const fileInfo = {
  filename: '/path/to/file.jpg',
  basename: 'file.jpg',
  mime: 'image/jpeg',
  etag: 'xyz987',
  hasPreview: true,
  fileid: 13579,
}
OCA.Viewer.open({
  fileinfo: fileInfo,
  list: [fileInfo],
})

The list parameter requires an array of fileinfo. You can check how we generate a fileinfo object here from a dav PROPFIND request data. There is currently no dedicated package for it, but this is coming. You can check the photos repository where we also use it.

  1. Open a file from an app's route
const fileInfo1 = {
  filename: 'https://next.cloud/apps/pizza/topping/pineapple.jpg',
  basename: 'pineapple.jpg',
  source: 'https://next.cloud/apps/pizza/topping/pineapple.jpg',
  mime: 'image/jpeg',
  etag: 'abc123',
  hasPreview: false,
  fileid: 12345,
}
const fileInfo2 = {
  filename: 'https://next.cloud/apps/pizza/topping/garlic.jpg',
  basename: 'garlic.jpg',
  source: 'https://next.cloud/apps/pizza/topping/garlic.jpg',
  mime: 'image/jpeg',
  etag: 'def456',
  hasPreview: false,
  fileid: 67890,
}
OCA.Viewer.open({
  fileInfo: fileInfo1,
  list: [fileInfo1, fileInfo2],
})

In order to open a shared file you will need to provide the share token so the Viewer can use it to authenticate the requests to the server. See the files_sharing app controller and template for an example.

Close the viewer

OCA.Viewer.close()

๐Ÿ” Add you own file view

If you want to make your app compatible with this app, you can use the OCA.Viewer methods

  1. Create a vue component which use the path and mime props (they will be automatically passed by the viewer)
  2. Register your mime viewer with the following:
     import VideoView from 'VideoView.vue'
    
     OCA.Viewer.registerHandler({
         // unique id
         id: 'video',
    
        // optional, it will group every view of this group and
        // use the proper view when building the file list
        // of the slideshow.
        // e.g. you open an image/jpeg that have the `media` group
        // you will be able to see the video/mpeg from the `video` handler
        // files that also have the `media` group set.
        group: 'media',
    
        // the list of mimes your component is able to display
        mimes: [
             'video/mpeg',
             'video/ogg',
             'video/webm',
             'video/mp4'
         ],
    
         // your vue component view
         component: VideoView
     })
  3. if you feel like your mime should be integrated on this repo, you can also create a pull request with your object on the models directory and the view on the components directory. Please have a look at what's already here and take example of it. ๐Ÿ™‡โ€โ™€๏ธ

viewer's People

Contributors

andyscherzinger avatar artonge avatar beardhatcode avatar christophwurst avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar gary-kim avatar hamza221 avatar jancborchardt avatar juliakirschenheuter avatar juliushaertl avatar kesselb avatar max-nextcloud avatar mejo- avatar mikescops avatar morrisjobke avatar nextcloud-bot avatar nextcloud-command avatar nickvergessen avatar npmbuildbot[bot] avatar pulsejet avatar pytal avatar renovate[bot] avatar rullzer avatar shgkme avatar skjnldsv avatar starypatyk avatar susnux avatar szaimen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

viewer's Issues

Use previews

I just tested with a 13MB image. Which Nextcloud already has previews for. It would be nice if this app used those to minimize data usage. Maybe a srcset could be used as well?

Respect sorting of the Files app

It seems that currently the order of the images is always based on "Modified date". However if you have your files sorted by Name or Size, the order of files in the Viewer should reflect that.

Always show header on mobile

When using viewer on mobile devices the header is inaccessible as it is shown on hover. We should always show it though.

UI: Download button missing for logged in users

After the upgade to Nextcloud 16 we got user complaints about the download button missing. It only seems to affect logged in users, please see the attached screenshots:

Preview for a logged in user (download button is missing):

01_nextcloud_logged_in_user

Preview when the same file is accessed from a share link instead (download button is displayed):

02_nextcloud_share_link

Error opening files

I canโ€™t open any image file, getting this error (both make dev-setup and make build-js ran through without issues):
viewer error

Console

Unhandled promise rejection Error: "Request failed with status code 404"

    createError createError.js:16 settle settle.js:18 handleLoad xhr.js:77 

es6.promise.js:110

    t es6.promise.js:110 exports _perform.js:3 O es6.promise.js:104 exports _invoke.js:5 <anonymous> _task.js:35 v _task.js:21 y _task.js:25 

Error loading /remote.php/dav/files/jan/IMG_6880.jpg 
error
โ€‹
bubbles: false
โ€‹
cancelBubble: false
โ€‹
cancelable: false
โ€‹
composed: false
โ€‹
currentTarget: null
โ€‹
defaultPrevented: false
โ€‹
eventPhase: 0
โ€‹
explicitOriginalTarget: <img class="file-view" data-v-d1e9a6b0="" style="height: 0px; width: 0px;โ€ฆ 0px; margin-left: 0px;" src="/remote.php/dav/files/jan/IMG_6880.jpg">
โ€‹
isTrusted: true
โ€‹
originalTarget: <img class="file-view" data-v-d1e9a6b0="" style="height: 0px; width: 0px;โ€ฆ 0px; margin-left: 0px;" src="/remote.php/dav/files/jan/IMG_6880.jpg">
โ€‹
srcElement: <img class="file-view" data-v-d1e9a6b0="" style="height: 0px; width: 0px;โ€ฆ 0px; margin-left: 0px;" src="/remote.php/dav/files/jan/IMG_6880.jpg">
โ€‹
target: <img class="file-view" data-v-d1e9a6b0="" style="height: 0px; width: 0px;โ€ฆ 0px; margin-left: 0px;" src="/remote.php/dav/files/jan/IMG_6880.jpg">
โ€‹
timeStamp: 12391
โ€‹
type: "error"
โ€‹
<get isTrusted()>: function isTrusted()
โ€‹
<prototype>: EventPrototype { composedPath: composedPath(), stopPropagation: stopPropagation(), stopImmediatePropagation: stopImmediatePropagation(), โ€ฆ }
Mime.js:55

    mounted Mime.js:55 

Same for videos:
viewer video load

Unhandled promise rejection Error: "Request failed with status code 404"

    createError createError.js:16 settle settle.js:18 handleLoad xhr.js:77 

es6.promise.js:110
HTTP load failed with status 404. Load of media resource http://localhost/remote.php/dav/files/jan/A.mp4 failed. files
All candidate resources failed to load. Media load paused.

Support PSD (photoshop documents) file

In a studio storage environment. It will be very helpful to view the files before downloading. If the viewer will support to view the PSD filetype, it makes nextcloud one step closer to DMS for studios and artists.

Not possible to circle around when you reached the end of the folder

Viewers on e.g. GNOME and macOS make it possible that when you reached the last file of the list, that you can continue, looping around to the first one. Same with the first one where you can go back to the last.

The Viewer app at the moment doesnโ€™t show the "Previous" button for the first image, or the "Next" and "Slideshow" buttons for the last. (This also makes it impossible to loop a slideshow.)

Instead, the viewer should just loop around and not have any specifics for the first or last image. :)

Handling conflict with Gallery previewer, files_videoviewer etc

So eventually this viewer should be the default viewer for all sorts of formats. Right now the Gallery app is taking precedence still.

Should we:

  • Disable the slideshow module of Gallery so that the viewer app is used?
  • Continue work on it and do that for 17
  • Something else?

Basically, when someone has Gallery and Videoviewer enabled but not Viewer, those apps should of course do the previews. But if you have Viewer enabled, this app should take over.

Support webp format

Hi there,

Is there any plan to add support for webp format in a near future ?

I already tried adding the mimetype as suggest in PR nextcloud/gallery#527, but it does not seem to have any effect (at least on NC 15)

Viewer canยดt handle # in mp4 file name

Describe the bug
A # character in the filename breaks the viewer. As you can see in the screenshot the viewer is not able to load the file. The JS seems to cut of the part after the # character.

To Reproduce

  1. Create a Mp4 file with a # character in its name
  2. Try to open the file with the viewer

Expected behavior
The video should be loaded / played.

Screenshots
viewer

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Firefox
  • Version 68

Videos on iOS are played in fullscreen mode

On iOS videos in the files viewer are always played in fullscreen mode, which needs to be closed before you can click an element in the viewer again.

Adding 'playsinline' to the video tag would play the video in the browser window instead.

Visualize tags

I think that it could be really interesting if the viewer could visualize the tags associated to the file under the same file preview.

This was already asked for the gallery app (if you are interested I can look for the issue) and several users were interested.

Thank you

What is Viewer supposed to be?

Hey, is Viewer meant to be a drop-in replacement for Gallery and Video Player? Currently the differences I have noted are:

  • absence of the download button
  • Viewer has better UI design than both
  • no Gallery view
  • Viewer does not work with shared links

Nextcloud 16.0.4 RC1 | Integrity check issue

Describe the bug
Integrity check reports missing file cypress.json.

To Reproduce
Steps to reproduce the behavior:

  1. Update Nextcloud to v16.0.4 RC1
  2. Check integrity check results

Expected behavior
No integrity check issues.

Screenshots

Technical information
=====================
The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.

Results
=======
- viewer
	- FILE_MISSING
		- cypress.json

Raw output
==========
Array
(
    [viewer] => Array
        (
            [FILE_MISSING] => Array
                (
                    [cypress.json] => Array
                        (
                            [expected] => bf773ddaccd4c55ed0653dfe26d462c7b459c894a21537dcbc153f02d676b0d894720354d842190ec2c4b9421b1cbfd1b772407c1c784577caf85abe556ecb54
                            [current] => 
                        )

                )

        )

)

I think this file should not exist on the final instance and the app works very well without it. Looks like is has been accidentally added to the integrity check?

Viewer also for public links

In public links the old gallery slideshow is used and not the new viewer. In the gallery slideshow no videos are supported. Would be great if the new viewer could also use for public links. PS: Thanks a lot for implementing the video support!

viewer content and sidebar content not in sync

I use the media viewer feature of the file explorer to manage my photos. I add tags and comments, so I can search and filter my photos later (e. g. show me all files tagged with "beach"). In another scenario I add comments to media files, so I can asynchronously communicate with other users of a Nextcloud instance (e. g. discuss mockups or blog post drafts).

However, I realized that the content of the viewer and the content of the sidebar are not in sync:

First, when you open picture A, and show the sidebar, you can add tags and comments etc. for picture A. When you switch to picture B in the viewer, the sidebar does not change but still shows tags and comments of picture A.

Steps to reproduce

  1. Create a folder and add some images
  2. Open the first image ("picture A") in the viewer
  3. Show the sidebar
  4. In the viewer, switch to the next or previous file ("picture B")

Screencast

https://youtu.be/i28S-FeizMY

Expected behaviour

Sidebar also updates its content to show tags and comments of picture B.

Actual behaviour

Sidebar keeps showing content (e. g. tags and comments) of picture A.

autocomplete for sharing is not displayed

Describe the bug
using "share" inside the text app shows no username autocomplete list

To Reproduce
Steps to reproduce the behavior:

  1. open text file in text app
  2. click share icon
  3. enter (partial) name in sharing field

Expected behavior
a list of users appears

Current behavior
list is not visible

Client details:

  • OS: Win 10
  • Browser: Firefox
  • Version: 68.0.1
  • Device: desktop
  • NC: 16.0.3
  • App: 1.0.1

The list is not visible, because the app-sidebar has an z-index of 15000 (if visible, set via JS). The .ui-autocomplete class for the user list is only z-index 1550, so the user list is behind the sidebar.

Use viewer in other apps

Hey!

I'm currently developing Maps app and would like to be able to launch the Viewer for pictures. Currently I'm opening a new tab to the gallery app but it would be nice to stay in the Maps app. I might want to use Viewer in GpxPod too.

When I include Viewer (script('viewer', 'viewer');) I get this in the browser:

OCA.Viewer initialized                Viewer.js:37:10
TypeError: OCA.Files is undefined     Viewer.vue:369
TypeError: OCA.Files is undefined     Viewer.vue:369

Would it be possible to make Viewer (or part of it) independent from files app?

Show images with proper orientation.

When I browse through images in the gallery they are not shown with the proper orientation. When you browse through the images in file explorers on either Linux of ms windows the pictures do show with the proper orientation.
When you open the picture with the viewer, the orientation is the same as in the gallery.
I guess the proper orientation is stored somewhere in the metadata of the files, could this be used to display the picture in the proper orientation?
(I guess this is also the reason why there is a request for a rotate button)

Viewer switches to next image when comment is submitted

From #230 by @floeschie

Second, when you add a comment to picture A and hit the ENTER button to submit the comment, the viewer switches to picture B, but the sidebar again keeps showing content of picture A.

Steps to reproduce

  1. Create a folder and add some images
  2. Open the first image ("picture A") in the viewer
  3. Show the sidebar
  4. Add a comment
  5. Hit ENTER button

Expected behaviour

Comment is submitted and the viewer keeps showing picture A.

Actual behaviour

Comment is submitted and the viewer switches to picture B. Sidebar still shows tags and comments of picture A.

Screencast

https://youtu.be/i28S-FeizMY

Additional information

  • Nextcloud version 16.0.4
  • Viewer version 1.1.0

[feature] Allow multiple handlers for same mime type and show selector

If multiple handlers are registered for the same mime types, open a selector to choose which one to use.


Original report:

Now that I implemented PDF support in Reader the need for an official way to select which app to use to handle a give mime type is starting to become an issue. Both NC and OC have an 'official' PDF viewer which does its job quite well and which might for one reason or another be preferred by Reader users over the version I implemented (even though Reader supports things like 2-page spread, position saving, night mode and bookmarks which the official/Mozilla viewer lacks). I could just add a personal preference section to allow users to choose which mime types Reader should handle but that is not a good solution in the light of a multitude of apps all handling the same mime type.

NC (and OC) need a mime type handler selector in the lines of the one used in Firefox:

image

Is something like this in the works?

16.0.2 integrity check failed

The viewer app throws a warning at setup check after nc update 16.0.1 --> 16.0.2:

Technical information
=====================
The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.

Results
=======
- viewer
	- EXTRA_FILE
		- cypress/utils/index.js
		- cypress/start.sh
		- cypress/plugins/index.js
		- cypress/support/commands.js
		- cypress/support/index.js
		- cypress/fixtures/image-small.png
		- cypress/fixtures/video1.mp4
		- cypress/fixtures/image.bmp
		- cypress/fixtures/video.mkv
		- cypress/fixtures/video.webm
		- cypress/fixtures/video.ogv
		- cypress/fixtures/image3.jpg
		- cypress/fixtures/image.svg
		- cypress/fixtures/image2.jpg
		- cypress/fixtures/video2.mp4
		- cypress/fixtures/image4.jpg
		- cypress/fixtures/image.png
		- cypress/fixtures/image.gif
		- cypress/fixtures/image1.jpg
		- cypress/integration/image-small.png.spec.js
		- cypress/integration/image.svg.spec.js
		- cypress/integration/video.webm.spec.js
		- cypress/integration/image.gif.spec.js
		- cypress/integration/videos.spec.js
		- cypress/integration/video.mp4.spec.js
		- cypress/integration/files.spec.js
		- cypress/integration/image.png.spec.js
		- cypress/integration/video.mkv.spec.js
		- cypress/integration/video.ogv.spec.js
		- cypress/integration/images.spec.js
		- cypress/stop.sh
		- cypress.json

Raw output
==========
Array
(
    [viewer] => Array
        (
            [EXTRA_FILE] => Array
                (
                    [cypress/utils/index.js] => Array
                        (
                            [expected] => 
                            [current] => 61e3b0405c0411708981a45154e13f124cc5bfc431a25d92580ae4ba5f276026d6df883702db3adc827a9dabfbe6bf377ceea5a2a7bcdc939ed2329cad2f8d33
                        )

                    [cypress/start.sh] => Array
                        (
                            [expected] => 
                            [current] => 8692dc0c8489fc602d55da7fdb5a858d9be8bcfb878b21457ea80443cd6b8bf9239d7453e96bc1f266f8a5165918fff44e4df11d36d8d349b31053f05bc94ab8
                        )

                    [cypress/plugins/index.js] => Array
                        (
                            [expected] => 
                            [current] => 03eb6d2dcce575ca0c1597700f6ad97014f96cb148785cbe948e2930588ec78aa234b8698c40883a318c65f8a88eb836093b85dada99ed1361dce3e4b050cb47
                        )

                    [cypress/support/commands.js] => Array
                        (
                            [expected] => 
                            [current] => 1cca271b4c349eefcc44450e439f17d53f84f2aa479291aceb14c2c9a69ad614d38bdd01611cbb1e7002493c84a934d548dfc5357808b61695ceb2cad7e28501
                        )

                    [cypress/support/index.js] => Array
                        (
                            [expected] => 
                            [current] => 782a5ca99cd32314d8d754ede1d867f95ba9aeb4f38014a94a04cb0d2e7ff6eab849a557e6022d16b780fe1728dc3e4db9157323b912a1892523e127847875fb
                        )

                    [cypress/fixtures/image-small.png] => Array
                        (
                            [expected] => 
                            [current] => 6a6e063dd89639fe22aec424a83c940ad6f724bb1582c779548e6d548790b822d067cb5b339b60ce520f9ce6ba2a6e5f10a0c079428035b0ff970cf65bb98064
                        )

                    [cypress/fixtures/video1.mp4] => Array
                        (
                            [expected] => 
                            [current] => 65e4b16ed459352fbce164a8d65ec8167dd4fafa4ebb8d00d2f2d8742f989afa09f4bb46ec51237ad10f346ba73e0415be8229be1dc929afb3dab8bb646ba0a1
                        )

                    [cypress/fixtures/image.bmp] => Array
                        (
                            [expected] => 
                            [current] => c9810c4167a43a3ddf16fc5d49cf8f6875c45dfb3bbb283b06d7345b4f9d97cf3633e3799216065e1db01291277332ab27b3acdd16285f2e81ed6a38fed57816
                        )

                    [cypress/fixtures/video.mkv] => Array
                        (
                            [expected] => 
                            [current] => 68c78a1437041453c713d447c0ac6aa466666a66369d98bde4b4d7ceb3f6fc1f683890caf5f6d5c500de1ca2a452697baa9b70e721ce4f9b39428a8a6e47c640
                        )

                    [cypress/fixtures/video.webm] => Array
                        (
                            [expected] => 
                            [current] => 3ef5faf52f935d5e322227e2f5907b156816f8c5a254a785a8d989852e2694cf4510e4d2d6c046d9b31900583ff44cbd1fc722de5b30ec134e300f3d9e685bfb
                        )

                    [cypress/fixtures/video.ogv] => Array
                        (
                            [expected] => 
                            [current] => e95c985cdaea0fd63ee1268ffa15feda87168c98e5a7114623b75bfd8d9782f51f77e16908975424285bd39aa52fae884fdd5a6625cd3a9c78a4cf8b2a9f3183
                        )

                    [cypress/fixtures/image3.jpg] => Array
                        (
                            [expected] => 
                            [current] => c112fc23235a414a2f86435f3c9cace73fca507782043c7518e0b3c5c34e190ba0709622c0efd34c126753bc5d960fe1a78bec0de6a3ec83a3d5626b5f0a408d
                        )

                    [cypress/fixtures/image.svg] => Array
                        (
                            [expected] => 
                            [current] => 75d274e7440faee5caa412ed3f1be20b5684c9c5cd19b60cc1524607a32770f8c44ddad9926fc6ac56134936e7b6721d9152f17ec06784e7cfd02c16600c8898
                        )

                    [cypress/fixtures/image2.jpg] => Array
                        (
                            [expected] => 
                            [current] => 81041d26e4f61d8b926e944cc457ba800b3062e2b835f2dc9286532da0c876ee0945193c54a1295aeb7bd212e55f842b67aed9b4e4c9a39630b0dc0c7b1ad0ce
                        )

                    [cypress/fixtures/video2.mp4] => Array
                        (
                            [expected] => 
                            [current] => 3ff782d0f1e29f573a7ba22e13007fc0927d5fec4845e77b9c6fe03f67de90b9133a6d145569f990080bee6c47a0a9939118afb113afbef848e3466a3bbb14c0
                        )

                    [cypress/fixtures/image4.jpg] => Array
                        (
                            [expected] => 
                            [current] => 033ee655d82249a110a237c1519fa145afc7383a0f27a676b53933949795590be251b83c799ad2700847c8ae6cf85f331a21617f5117a51cc38b8c6c2425299c
                        )

                    [cypress/fixtures/image.png] => Array
                        (
                            [expected] => 
                            [current] => 50e54358eb0473f9894f54cffcf10a62321321d4db08d62425f6947149d5afde2d080d089fbe94c12d94e23c193e34393169c28f914f22004e61d3cd91fea448
                        )

                    [cypress/fixtures/image.gif] => Array
                        (
                            [expected] => 
                            [current] => 4b8fc05bc9b8546c77fc06577a6f7d771b2f89143eede005c7f240a154c2283e3cd68d84a8afbd61b9b2ff0b3d45a2965ed7495b8a0d73af233b80cc82dc61e2
                        )

                    [cypress/fixtures/image1.jpg] => Array
                        (
                            [expected] => 
                            [current] => c219f5c35cf5f2ecbc1e2121537ffc1f9c8e063adeaad2fb820393704250c53c6b4ff388e294f4909c501e10688c691dc7257130600de230984f1f4110e78a99
                        )

                    [cypress/integration/image-small.png.spec.js] => Array
                        (
                            [expected] => 
                            [current] => daa93e864599bfd53fac612981afec3226cb189ab126a4b7e68ebed66905d409a940eeb2e8df0fd5b569da72db2cc476de03847a4bf429515187e88a81959c74
                        )

                    [cypress/integration/image.svg.spec.js] => Array
                        (
                            [expected] => 
                            [current] => cec04f1e2c153bbed680684ac78694f58ea3ded6e84af2b8f601b59e582c2379459795e484f7ab3b4b7f7a8facdd62811a3fa930d5517bc39aff6592d212b8c6
                        )

                    [cypress/integration/video.webm.spec.js] => Array
                        (
                            [expected] => 
                            [current] => a80b0c73c088ed9b38f3d611542b266418ec5ad1dd2688908ebe25488769327713e568b8b33526b1367695ab49211406251e49ed00fe73a06d66cf04624bef97
                        )

                    [cypress/integration/image.gif.spec.js] => Array
                        (
                            [expected] => 
                            [current] => aa460a5c24d921926a74bb18ac241103e7cfb0268843ae02fac2fc84dcf4e4c24e2060f020d7899e26fe39135a846f30c2859050ec75bd64dde87faeea344b14
                        )

                    [cypress/integration/videos.spec.js] => Array
                        (
                            [expected] => 
                            [current] => f9de7731b4430677b0a5739ecfdf73ebad7d6912c7f468177846e09e5b75cfd962b576b3e31d7546c5ff055e2caf49311bce81c7a0fd407b262f71050366d076
                        )

                    [cypress/integration/video.mp4.spec.js] => Array
                        (
                            [expected] => 
                            [current] => b1961b28616b8abff2b634b81e74b39e045f2f5852c2c4276c75bb67e3c97e0a5396ae27a2f23e65ac2d7b12ef0d13125c88c53175391514c8a932e5d1a658d4
                        )

                    [cypress/integration/files.spec.js] => Array
                        (
                            [expected] => 
                            [current] => 7c295f26d37e0e2db83bfbd9e58beed08fe7da5b731e5944aefab568396d9bb328bb59d0c1b86c919cb8dd445bba37f77f83a8381c54ac8879c3d2b9c2798cd6
                        )

                    [cypress/integration/image.png.spec.js] => Array
                        (
                            [expected] => 
                            [current] => 475d783a88adfe90a7f2703b53edc406380979d1314c9f8726ebfb6378b0c6b6a645c78f591499b66bfb624e20e228f6fbb123f6daa5457223dd1be5856ad9fe
                        )

                    [cypress/integration/video.mkv.spec.js] => Array
                        (
                            [expected] => 
                            [current] => 554f3a94dc76c500244b5f55b1b1e7d3cb487932284ad908e7ebc0139d373cd5de9bde697bf54205d049e5174a85a888e59430b3b795b2db7c9f1f2f0c0de001
                        )

                    [cypress/integration/video.ogv.spec.js] => Array
                        (
                            [expected] => 
                            [current] => efbd8643c7977b5fd89265a0195c0fc856e9c97eccd6c7a71c66130463c2dd1c3156ffd02b7368af9addc2ec25fe9bd9d28f98c914eaffa9f5c24a7e17567bf3
                        )

                    [cypress/integration/images.spec.js] => Array
                        (
                            [expected] => 
                            [current] => 36df65eda12222d85676416c7f8771652c05bc05108d033bcd2b65527112cfddfb2df9137fb9e9f6253a5bebb76c9051b1bbe5ca31c60735680b8960ccc9c4ba
                        )

                    [cypress/stop.sh] => Array
                        (
                            [expected] => 
                            [current] => ee4700342e52524f88da50a64426aeea94aa5857ac446ddae9015e35e8f1d92fd7e7baa5a4f80235bb149bb9c2d82903534d73ee03e75066f4cbf150141d27f0
                        )

                    [cypress.json] => Array
                        (
                            [expected] => 
                            [current] => bf773ddaccd4c55ed0653dfe26d462c7b459c894a21537dcbc153f02d676b0d894720354d842190ec2c4b9421b1cbfd1b772407c1c784577caf85abe556ecb54
                        )

                )

        )

)

Use dav SEARCH for better results

See nextcloud/server#14313

await axios({
  method: 'SEARCH',
  url: '/remote.php/dav/',
  headers: {'requesttoken': OC.requestToken, 'content-Type': 'text/xml'},
  data: `<?xml version="1.0" encoding="UTF-8"?>
<d:searchrequest xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
    <d:basicsearch>
        <d:select>
            <d:prop>
                 <oc:fileid/>
                 <d:displayname/>
                 <d:getcontenttype/>
                 <d:getetag/>
                 <oc:size/>
            </d:prop>
        </d:select>
        <d:from>
            <d:scope>
                <d:href>/files/admin/</d:href>
                <d:depth>infinity</d:depth>
            </d:scope>
        </d:from>
        <d:where>
            <d:like>
                <d:prop>
                    <d:getcontenttype/>
                </d:prop>
                <d:literal>image/%</d:literal>
            </d:like>
        </d:where>
        <d:orderby>
            <d:prop>
                <oc:size/>
            </d:prop>
            <d:ascending/>
        </d:orderby>
    </d:basicsearch>
</d:searchrequest>`
});

Integrate with other Nextcloud apps

From the original issue at nextcloud/server#12382, the viewer should be used for all kinds of different apps:

  • Mail: attachments, or clicking on inline images
  • Contacts: profile pictures
  • Social: any posted pictures
  • Talk: files posted in chat
  • Deck: attachments of a task
  • Files shared via link

add subtitles for video feature

add this code to Videos.vue : template->video support many subtitle
`

	<track
		:src="davPath.replace(/\.[^\.]+$/, '.vi.vtt')"
		label="Vietnamess"
		kind="captions"
		srclang="vi-vn" default />`

NextCloud after update 16.01 to 16.02

After upgrade, I have an error integrity check of this app in my Nextcloud installation.

Technical information

The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.

Results

  • viewer
    • EXTRA_FILE
      • cypress/fixtures/video.mkv
      • cypress/fixtures/video.webm
      • cypress/fixtures/image-small.png
      • cypress/fixtures/image3.jpg
      • cypress/fixtures/video.ogv
      • cypress/fixtures/video2.mp4
      • cypress/fixtures/image1.jpg
      • cypress/fixtures/image2.jpg
      • cypress/fixtures/image.png
      • cypress/fixtures/image.bmp
      • cypress/fixtures/video1.mp4
      • cypress/fixtures/image.gif
      • cypress/fixtures/image4.jpg
      • cypress/fixtures/image.svg
      • cypress/integration/video.mkv.spec.js
      • cypress/integration/image.gif.spec.js
      • cypress/integration/video.ogv.spec.js
      • cypress/integration/videos.spec.js
      • cypress/integration/image.svg.spec.js
      • cypress/integration/image-small.png.spec.js
      • cypress/integration/video.mp4.spec.js
      • cypress/integration/images.spec.js
      • cypress/integration/video.webm.spec.js
      • cypress/integration/image.png.spec.js
      • cypress/integration/files.spec.js
      • cypress/start.sh
      • cypress/plugins/index.js
      • cypress/support/commands.js
      • cypress/support/index.js
      • cypress/utils/index.js
      • cypress/stop.sh
      • cypress.json

Raw output

Array
(
[viewer] => Array
(
[EXTRA_FILE] => Array
(
[cypress/fixtures/video.mkv] => Array
(
[expected] =>
[current] => 68c78a1437041453c713d447c0ac6aa466666a66369d98bde4b4d7ceb3f6fc1f683890caf5f6d5c500de1ca2a452697baa9b70e721ce4f9b39428a8a6e47c640
)

                [cypress/fixtures/video.webm] => Array
                    (
                        [expected] => 
                        [current] => 3ef5faf52f935d5e322227e2f5907b156816f8c5a254a785a8d989852e2694cf4510e4d2d6c046d9b31900583ff44cbd1fc722de5b30ec134e300f3d9e685bfb
                    )

                [cypress/fixtures/image-small.png] => Array
                    (
                        [expected] => 
                        [current] => 6a6e063dd89639fe22aec424a83c940ad6f724bb1582c779548e6d548790b822d067cb5b339b60ce520f9ce6ba2a6e5f10a0c079428035b0ff970cf65bb98064
                    )

                [cypress/fixtures/image3.jpg] => Array
                    (
                        [expected] => 
                        [current] => c112fc23235a414a2f86435f3c9cace73fca507782043c7518e0b3c5c34e190ba0709622c0efd34c126753bc5d960fe1a78bec0de6a3ec83a3d5626b5f0a408d
                    )

                [cypress/fixtures/video.ogv] => Array
                    (
                        [expected] => 
                        [current] => e95c985cdaea0fd63ee1268ffa15feda87168c98e5a7114623b75bfd8d9782f51f77e16908975424285bd39aa52fae884fdd5a6625cd3a9c78a4cf8b2a9f3183
                    )

                [cypress/fixtures/video2.mp4] => Array
                    (
                        [expected] => 
                        [current] => 3ff782d0f1e29f573a7ba22e13007fc0927d5fec4845e77b9c6fe03f67de90b9133a6d145569f990080bee6c47a0a9939118afb113afbef848e3466a3bbb14c0
                    )

                [cypress/fixtures/image1.jpg] => Array
                    (
                        [expected] => 
                        [current] => c219f5c35cf5f2ecbc1e2121537ffc1f9c8e063adeaad2fb820393704250c53c6b4ff388e294f4909c501e10688c691dc7257130600de230984f1f4110e78a99
                    )

                [cypress/fixtures/image2.jpg] => Array
                    (
                        [expected] => 
                        [current] => 81041d26e4f61d8b926e944cc457ba800b3062e2b835f2dc9286532da0c876ee0945193c54a1295aeb7bd212e55f842b67aed9b4e4c9a39630b0dc0c7b1ad0ce
                    )

                [cypress/fixtures/image.png] => Array
                    (
                        [expected] => 
                        [current] => 50e54358eb0473f9894f54cffcf10a62321321d4db08d62425f6947149d5afde2d080d089fbe94c12d94e23c193e34393169c28f914f22004e61d3cd91fea448
                    )

                [cypress/fixtures/image.bmp] => Array
                    (
                        [expected] => 
                        [current] => c9810c4167a43a3ddf16fc5d49cf8f6875c45dfb3bbb283b06d7345b4f9d97cf3633e3799216065e1db01291277332ab27b3acdd16285f2e81ed6a38fed57816
                    )

                [cypress/fixtures/video1.mp4] => Array
                    (
                        [expected] => 
                        [current] => 65e4b16ed459352fbce164a8d65ec8167dd4fafa4ebb8d00d2f2d8742f989afa09f4bb46ec51237ad10f346ba73e0415be8229be1dc929afb3dab8bb646ba0a1
                    )

                [cypress/fixtures/image.gif] => Array
                    (
                        [expected] => 
                        [current] => 4b8fc05bc9b8546c77fc06577a6f7d771b2f89143eede005c7f240a154c2283e3cd68d84a8afbd61b9b2ff0b3d45a2965ed7495b8a0d73af233b80cc82dc61e2
                    )

                [cypress/fixtures/image4.jpg] => Array
                    (
                        [expected] => 
                        [current] => 033ee655d82249a110a237c1519fa145afc7383a0f27a676b53933949795590be251b83c799ad2700847c8ae6cf85f331a21617f5117a51cc38b8c6c2425299c
                    )

                [cypress/fixtures/image.svg] => Array
                    (
                        [expected] => 
                        [current] => 75d274e7440faee5caa412ed3f1be20b5684c9c5cd19b60cc1524607a32770f8c44ddad9926fc6ac56134936e7b6721d9152f17ec06784e7cfd02c16600c8898
                    )

                [cypress/integration/video.mkv.spec.js] => Array
                    (
                        [expected] => 
                        [current] => 554f3a94dc76c500244b5f55b1b1e7d3cb487932284ad908e7ebc0139d373cd5de9bde697bf54205d049e5174a85a888e59430b3b795b2db7c9f1f2f0c0de001
                    )

                [cypress/integration/image.gif.spec.js] => Array
                    (
                        [expected] => 
                        [current] => aa460a5c24d921926a74bb18ac241103e7cfb0268843ae02fac2fc84dcf4e4c24e2060f020d7899e26fe39135a846f30c2859050ec75bd64dde87faeea344b14
                    )

                [cypress/integration/video.ogv.spec.js] => Array
                    (
                        [expected] => 
                        [current] => efbd8643c7977b5fd89265a0195c0fc856e9c97eccd6c7a71c66130463c2dd1c3156ffd02b7368af9addc2ec25fe9bd9d28f98c914eaffa9f5c24a7e17567bf3
                    )

                [cypress/integration/videos.spec.js] => Array
                    (
                        [expected] => 
                        [current] => f9de7731b4430677b0a5739ecfdf73ebad7d6912c7f468177846e09e5b75cfd962b576b3e31d7546c5ff055e2caf49311bce81c7a0fd407b262f71050366d076
                    )

                [cypress/integration/image.svg.spec.js] => Array
                    (
                        [expected] => 
                        [current] => cec04f1e2c153bbed680684ac78694f58ea3ded6e84af2b8f601b59e582c2379459795e484f7ab3b4b7f7a8facdd62811a3fa930d5517bc39aff6592d212b8c6
                    )

                [cypress/integration/image-small.png.spec.js] => Array
                    (
                        [expected] => 
                        [current] => daa93e864599bfd53fac612981afec3226cb189ab126a4b7e68ebed66905d409a940eeb2e8df0fd5b569da72db2cc476de03847a4bf429515187e88a81959c74
                    )

                [cypress/integration/video.mp4.spec.js] => Array
                    (
                        [expected] => 
                        [current] => b1961b28616b8abff2b634b81e74b39e045f2f5852c2c4276c75bb67e3c97e0a5396ae27a2f23e65ac2d7b12ef0d13125c88c53175391514c8a932e5d1a658d4
                    )

                [cypress/integration/images.spec.js] => Array
                    (
                        [expected] => 
                        [current] => 36df65eda12222d85676416c7f8771652c05bc05108d033bcd2b65527112cfddfb2df9137fb9e9f6253a5bebb76c9051b1bbe5ca31c60735680b8960ccc9c4ba
                    )

                [cypress/integration/video.webm.spec.js] => Array
                    (
                        [expected] => 
                        [current] => a80b0c73c088ed9b38f3d611542b266418ec5ad1dd2688908ebe25488769327713e568b8b33526b1367695ab49211406251e49ed00fe73a06d66cf04624bef97
                    )

                [cypress/integration/image.png.spec.js] => Array
                    (
                        [expected] => 
                        [current] => 475d783a88adfe90a7f2703b53edc406380979d1314c9f8726ebfb6378b0c6b6a645c78f591499b66bfb624e20e228f6fbb123f6daa5457223dd1be5856ad9fe
                    )

                [cypress/integration/files.spec.js] => Array
                    (
                        [expected] => 
                        [current] => 7c295f26d37e0e2db83bfbd9e58beed08fe7da5b731e5944aefab568396d9bb328bb59d0c1b86c919cb8dd445bba37f77f83a8381c54ac8879c3d2b9c2798cd6
                    )

                [cypress/start.sh] => Array
                    (
                        [expected] => 
                        [current] => 8692dc0c8489fc602d55da7fdb5a858d9be8bcfb878b21457ea80443cd6b8bf9239d7453e96bc1f266f8a5165918fff44e4df11d36d8d349b31053f05bc94ab8
                    )

                [cypress/plugins/index.js] => Array
                    (
                        [expected] => 
                        [current] => 03eb6d2dcce575ca0c1597700f6ad97014f96cb148785cbe948e2930588ec78aa234b8698c40883a318c65f8a88eb836093b85dada99ed1361dce3e4b050cb47
                    )

                [cypress/support/commands.js] => Array
                    (
                        [expected] => 
                        [current] => 1cca271b4c349eefcc44450e439f17d53f84f2aa479291aceb14c2c9a69ad614d38bdd01611cbb1e7002493c84a934d548dfc5357808b61695ceb2cad7e28501
                    )

                [cypress/support/index.js] => Array
                    (
                        [expected] => 
                        [current] => 782a5ca99cd32314d8d754ede1d867f95ba9aeb4f38014a94a04cb0d2e7ff6eab849a557e6022d16b780fe1728dc3e4db9157323b912a1892523e127847875fb
                    )

                [cypress/utils/index.js] => Array
                    (
                        [expected] => 
                        [current] => 61e3b0405c0411708981a45154e13f124cc5bfc431a25d92580ae4ba5f276026d6df883702db3adc827a9dabfbe6bf377ceea5a2a7bcdc939ed2329cad2f8d33
                    )

                [cypress/stop.sh] => Array
                    (
                        [expected] => 
                        [current] => ee4700342e52524f88da50a64426aeea94aa5857ac446ddae9015e35e8f1d92fd7e7baa5a4f80235bb149bb9c2d82903534d73ee03e75066f4cbf150141d27f0
                    )

                [cypress.json] => Array
                    (
                        [expected] => 
                        [current] => bf773ddaccd4c55ed0653dfe26d462c7b459c894a21537dcbc153f02d676b0d894720354d842190ec2c4b9421b1cbfd1b772407c1c784577caf85abe556ecb54

Integrating with Camera Raw Previews app

Hi,
I have my Camera Raw Previews app installed and can get thumbnails of CR2 files and other raw files.
My app registers certain extensions to the 'image/x-dcraw' mime.

What is needed to get these files to open with Viewer instead of just downloading them?

Full screenview and fullscreen.

Thanks for the application.. :
At some point I tried to do something similar with lightgallery.js.. ๐Ÿ˜…
..and although I can request many features, this seems to me the most basic.. ๐Ÿ˜‰

zoom feature

  • If I am visualizing photos, with full quality, I want to be able to enlarge the image to see the details..
  • NOTE: I saw a discussion about using thumbnails or not in another issue. I also think that we have to use the originals, mostly due of this point that I propose, but would be nice to download a small thumbnail, to show background while loading the original.

Full viewscreen

  • e.g.: If the idea is to expand the functionality, to visualize any content, I am tempted to write a plugin, to view the pdf, but to be useful, it must expand to occupy the entire viewport.

Full screen.

  • If there is a button to play the photos and videos in sequence, why not do it in full screen. ?

Thanks again, ๐Ÿ˜„

Background transparency

Is your feature request related to a problem? Please describe.
I would like to be able to eliminate the transparency and use a black background. Seeing other files listed behind an image takes away from the image viewing experience. All emphasis should be on the photo, not other NextCloud files.

Describe the solution you'd like
I would like a configuration option to set the viewer transparency percentage. If that's not possible, I'd like to just have a black background instead of a transparent one.

Describe alternatives you've considered
The only alternative I have found is to disable this viewer and use the gallery viewer for photos. This might not be an option in the future depending on if the gallery app is changed to use this viewer instead of it's own.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.