Not possible to disable video player (viewer)

Is there way how to specify MIME types in config/config.php or in admin settings which schould be used in apps/viewer (photos and videos viewer)?

My goal is to do not open this viewer for all videos after clic on the file. (just only pictures should use it)

My nextCloud is 19.0.0
apps/viewer version 1.3.0

Or is there another way how to reach this functionality?

/path/to/nextcloud/core/shipped.json, remove viewer under “alwaysEnabled” to make possible to disable it in appstore.

1 Like

Okay I found a way to disable the “viewer” app.

  1. As mentioned by @BraveSail you need to remove the “viewer” in the core/shipped.json file.
  2. Then you will be able to see the Viewer in your app web UI. You can go ahead and disable it in the UI.

Is there a possibility to disable the “viewer” only for public downloads and set a Group and only enable it for Users?

I think not. But you can modify the link:

Link with preview: Nextcloud
Link to download: https://nc.nl.tab.digital/s/HWmDSnQ8qKbdGpT/download

If i get the second link (e.g. from e-mail) i would not test the link without “/download”.
Because of Javascript i think there is also no big performance issue for playing video in Nextcloud. The video must be downloaded in both cases. In Nextcloud perhaps not the full video.

1 Like

Thank you for your help.
I run NC on a Raspberry PI4 and if the Users start to play the Video, they only hear the Sound so i want to prevent the Video Playback.
Could i do this with changing the mimetypes for example?

I wouldn’t mind if users saw a black video. At some point, they will probably notice that something is missing.

Changing Mime-Types is good.

Read
https://docs.nextcloud.com/server/latest/admin_manual/configuration_mimetypes/index.html

Standard:
server/mimetypemapping.dist.json at master · nextcloud/server · GitHub
Raw File: https://raw.githubusercontent.com/nextcloud/server/master/resources/config/mimetypemapping.dist.json

Folder: /pfad/zur/nextcloud/resources/config

Destination file name: mimetypemapping.json
(do not use orgin file because of nextcloud updates)

"mp4": ["video/mp4"],
can perhaps changed to
"mp4": ["application/octet-stream"],
(see e.g. mime-type from swf)

OK i copied mimetypemapping.dist.json to resources/config and named it mimetypemapping.json.
But when i change the mp4 Parameter to this for example: [“application/internet-shortcut”] and then run this command: occ maintenance:mimetype:update-js
the settings should be active, right?
But when i click on an mp4 File the Video Playback starts again…

Sorry. I think it is the wrong destination path:

nextcloud/config/mimetypealiases.json

Instead, create your own nextcloud/config/mimetypealiases.json file with your custom aliases.

Sorry. I think it is the wrong destination path … not “resources” … my fault.

nextcloud/config/mimetypealiases.json

Instead, create your own nextcloud/config/mimetypealiases.json file with your custom aliases.

OK so i made an extra File in this directory nextcloud/config/mimetypealiases.json
But the Changes do not affect, maybe i am doing it wrong?
The Content of the File looks like this:

{
"mp4": ["application/internet-shortcut"]
}

Sorry no real idea. Perhaps you can delete/remove the old file that Nextcloud must use the new file.

OK that helped but can i link the /download Asset when i click on that file?

Now i got it!
The Content of the File stayed the same and when i deleted my Files and reuploaded they now get downloaded directly.
Thank you for your help @devnull :slight_smile:

OK it works on my Desktop Browser and on my iPhone at Safari and not in FF or Chrome on mobile Devices. I don’t get it but i think that’s enough for me ^^

Perhaps a problem of mime-type
application/internet-shortcut
Test
application/octet-stream

That also don’t work for me.
Even when i delete every Entry with “video” in that file the results don’t change.
That’s a little frustrating ^^