diff --git a/src/routes/MetaDetails/StreamsList/Stream/Stream.js b/src/routes/MetaDetails/StreamsList/Stream/Stream.js
index e5a8717cb..c556fa1e2 100644
--- a/src/routes/MetaDetails/StreamsList/Stream/Stream.js
+++ b/src/routes/MetaDetails/StreamsList/Stream/Stream.js
@@ -93,6 +93,10 @@ const Stream = ({ className, videoId, videoReleased, addonName, name, descriptio
return deepLinks?.externalPlayer?.download;
}, [deepLinks]);
+ const magnetLink = React.useMemo(() => {
+ return deepLinks?.externalPlayer?.magnet;
+ }, [deepLinks]);
+
const markVideoAsWatched = React.useCallback(() => {
if (typeof videoId === 'string') {
core.transport.dispatch({
@@ -106,6 +110,10 @@ const Stream = ({ className, videoId, videoReleased, addonName, name, descriptio
}, [videoId, videoReleased]);
const onClick = React.useCallback((event) => {
+ if (event.nativeEvent.togglePopupPrevented) {
+ return;
+ }
+
if (profile.settings.playerType !== null) {
markVideoAsWatched();
toast.show({
@@ -120,6 +128,28 @@ const Stream = ({ className, videoId, videoReleased, addonName, name, descriptio
}
}, [props.onClick, profile.settings, markVideoAsWatched]);
+ const copyMagnetLink = React.useCallback((event) => {
+ event.preventDefault();
+ closeMenu();
+ if (magnetLink) {
+ navigator.clipboard.writeText(magnetLink)
+ .then(() => {
+ toast.show({
+ type: 'success',
+ title: t('PLAYER_COPY_MAGNET_LINK_SUCCESS'),
+ timeout: 4000
+ });
+ })
+ .catch(() => {
+ toast.show({
+ type: 'error',
+ title: t('PLAYER_COPY_MAGNET_LINK_ERROR'),
+ timeout: 4000,
+ });
+ });
+ }
+ }, [magnetLink]);
+
const copyDownloadLink = React.useCallback((event) => {
event.preventDefault();
closeMenu();
@@ -221,6 +251,13 @@ const Stream = ({ className, videoId, videoReleased, addonName, name, descriptio
{t('CTX_COPY_STREAM_LINK')}
}
+ {
+ magnetLink &&
+
+ }
{
downloadLink &&