share: enable sharing smaller videos
Signed-off-by: Varun Patil <radialapps@gmail.com>dexie
parent
23d54d3f3b
commit
5fac290b37
|
@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
|
||||||
- **Feature**: View file in folder on clicking name in sidebar
|
- **Feature**: View file in folder on clicking name in sidebar
|
||||||
- **Feature**: User can leave albums that are shared with them
|
- **Feature**: User can leave albums that are shared with them
|
||||||
- **Feature**: Admin can now configure default behavior of loading high resolution image in viewer ([#672](https://github.com/pulsejet/memories/pull/672))
|
- **Feature**: Admin can now configure default behavior of loading high resolution image in viewer ([#672](https://github.com/pulsejet/memories/pull/672))
|
||||||
|
- **Feature**: Shared videos will now be transcoded to be smaller in size
|
||||||
- **Fix**: Support for transcoding MKV files.
|
- **Fix**: Support for transcoding MKV files.
|
||||||
|
|
||||||
## [v5.4.1] - 2023-08-20
|
## [v5.4.1] - 2023-08-20
|
||||||
|
|
|
@ -206,7 +206,7 @@ class VideoController extends GenericApiController
|
||||||
// If this is H.264 it won't get transcoded anyway
|
// If this is H.264 it won't get transcoded anyway
|
||||||
if ($liveVideoPath) {
|
if ($liveVideoPath) {
|
||||||
return Util::guardExDirect(function ($out) use ($transcode, $liveVideoPath) {
|
return Util::guardExDirect(function ($out) use ($transcode, $liveVideoPath) {
|
||||||
$this->getUpstream($transcode, $liveVideoPath, 'max.mov');
|
$this->getUpstream($transcode, $liveVideoPath, 'max.mp4');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ use OCA\Memories\Util;
|
||||||
class BinExt
|
class BinExt
|
||||||
{
|
{
|
||||||
public const EXIFTOOL_VER = '12.60';
|
public const EXIFTOOL_VER = '12.60';
|
||||||
public const GOVOD_VER = '0.1.14';
|
public const GOVOD_VER = '0.1.15';
|
||||||
public const NX_VER_MIN = '1.0';
|
public const NX_VER_MIN = '1.0';
|
||||||
|
|
||||||
/** Copy a binary to temp dir for execution */
|
/** Copy a binary to temp dir for execution */
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<ul class="options" v-else>
|
<ul class="options" v-else>
|
||||||
<NcListItem
|
<NcListItem
|
||||||
v-if="canShareNative && !isVideo && !isLocal"
|
v-if="canShareNative && canShareTranscode"
|
||||||
:title="t('memories', 'Reduced Size')"
|
:title="t('memories', 'Reduced Size')"
|
||||||
:bold="false"
|
:bold="false"
|
||||||
@click.prevent="sharePreview()"
|
@click.prevent="sharePreview()"
|
||||||
|
@ -19,12 +19,16 @@
|
||||||
<PhotoIcon class="avatar" :size="24" />
|
<PhotoIcon class="avatar" :size="24" />
|
||||||
</template>
|
</template>
|
||||||
<template #subtitle>
|
<template #subtitle>
|
||||||
{{ t('memories', 'Share a lower resolution image preview') }}
|
{{
|
||||||
|
isVideo
|
||||||
|
? t('memories', 'Share the video as a low quality MP4')
|
||||||
|
: t('memories', 'Share a lower resolution image preview')
|
||||||
|
}}
|
||||||
</template>
|
</template>
|
||||||
</NcListItem>
|
</NcListItem>
|
||||||
|
|
||||||
<NcListItem
|
<NcListItem
|
||||||
v-if="canShareNative && canShareHighRes"
|
v-if="canShareNative && canShareTranscode"
|
||||||
:title="t('memories', 'High Resolution')"
|
:title="t('memories', 'High Resolution')"
|
||||||
:bold="false"
|
:bold="false"
|
||||||
@click.prevent="shareHighRes()"
|
@click.prevent="shareHighRes()"
|
||||||
|
@ -35,7 +39,7 @@
|
||||||
<template #subtitle>
|
<template #subtitle>
|
||||||
{{
|
{{
|
||||||
isVideo
|
isVideo
|
||||||
? t('memories', 'Share the video as a high quality MOV')
|
? t('memories', 'Share the video as a high quality MP4')
|
||||||
: t('memories', 'Share the image as a high quality JPEG')
|
: t('memories', 'Share the image as a high quality JPEG')
|
||||||
}}
|
}}
|
||||||
</template>
|
</template>
|
||||||
|
@ -124,7 +128,7 @@ export default defineComponent({
|
||||||
return 'share' in navigator || nativex.has();
|
return 'share' in navigator || nativex.has();
|
||||||
},
|
},
|
||||||
|
|
||||||
canShareHighRes(): boolean {
|
canShareTranscode(): boolean {
|
||||||
return !this.isLocal && (!this.isVideo || !this.config.vod_disable);
|
return !this.isLocal && (!this.isVideo || !this.config.vod_disable);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -157,16 +161,17 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
async sharePreview() {
|
async sharePreview() {
|
||||||
const src = utils.getPreviewUrl({
|
const src = this.isVideo
|
||||||
photo: this.photo!,
|
? API.VIDEO_TRANSCODE(this.photo!.fileid, '480p.mp4')
|
||||||
size: 2048,
|
: utils.getPreviewUrl({ photo: this.photo!, size: 2048 });
|
||||||
});
|
|
||||||
this.shareWithHref(src, true);
|
this.shareWithHref(src, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
async shareHighRes() {
|
async shareHighRes() {
|
||||||
const fileid = this.photo!.fileid;
|
const fileid = this.photo!.fileid;
|
||||||
const src = this.isVideo ? API.VIDEO_TRANSCODE(fileid, 'max.mov') : API.IMAGE_DECODABLE(fileid, this.photo!.etag);
|
const src = this.isVideo
|
||||||
|
? API.VIDEO_TRANSCODE(fileid, '1080p.mp4')
|
||||||
|
: API.IMAGE_DECODABLE(fileid, this.photo!.etag);
|
||||||
this.shareWithHref(src, !this.isVideo);
|
this.shareWithHref(src, !this.isVideo);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue