Merge pull request #424 from ckcr4lyf/copy-stream-url

Add a "Copy Stream URL" button in the dropdown menu, for easy Direct Play in VLC
This commit is contained in:
Joshua M. Boniface
2019-08-31 21:52:58 -04:00
committed by GitHub
4 changed files with 25 additions and 1 deletions
+1
View File
@@ -26,6 +26,7 @@
- [Oddstr13](https://github.com/oddstr13)
- [petermcneil](https://github.com/petermcneil)
- [lewazo](https://github.com/lewazo)
- [Raghu Saxena](https://github.com/ckcr4lyf)
# Emby Contributors
+21
View File
@@ -134,6 +134,11 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
name: globalize.translate('Download'),
id: 'download'
});
commands.push({
name: globalize.translate('CopyStreamURL'),
id: 'copy-stream'
});
}
var canEdit = itemHelper.canEdit(user, item);
@@ -305,6 +310,22 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
getResolveFunction(getResolveFunction(resolve, id), id)();
});
break;
case 'copy-stream':
var downloadHref = apiClient.getItemDownloadUrl(itemId);
var textArea = document.createElement("textarea");
textArea.value = downloadHref;
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
try {
document.execCommand('copy');
} catch (err) {
console.error("Failed to copy to clipboard");
}
document.body.removeChild(textArea);
getResolveFunction(resolve, id)();
break;
case 'editsubtitles':
require(['subtitleEditor'], function (subtitleEditor) {
subtitleEditor.show(itemId, serverId).then(getResolveFunction(resolve, id, true), getResolveFunction(resolve, id));
+2 -1
View File
@@ -452,5 +452,6 @@
"HeaderPassword": "Password",
"HeaderPasswordReset": "Password Reset",
"HeaderPaths": "Paths",
"HeaderPendingInvitations": "Pending Invitations"
"HeaderPendingInvitations": "Pending Invitations",
"CopyStreamURL": "Copy Stream URL"
}
+1
View File
@@ -160,6 +160,7 @@
"Connect": "Connect",
"ContinueWatching": "Continue watching",
"Continuing": "Continuing",
"CopyStreamURL": "Copy Stream URL",
"CriticRating": "Critic rating",
"CustomDlnaProfilesHelp": "Create a custom profile to target a new device or override a system profile.",
"DateAdded": "Date added",