|
@@ -110,6 +110,33 @@ extension NCMedia {
|
|
|
)
|
|
|
)
|
|
|
|
|
|
+ actions.append(
|
|
|
+ NCMenuAction(
|
|
|
+ title: NSLocalizedString("_play_from_url_", comment: ""),
|
|
|
+ icon: NCUtility.shared.loadImage(named: "network"),
|
|
|
+ action: { _ in
|
|
|
+
|
|
|
+ let alert = UIAlertController(title: NSLocalizedString("_valid_video_url_", comment: ""), message: nil, preferredStyle: .alert)
|
|
|
+ alert.addAction(UIAlertAction(title: NSLocalizedString("_cancel_", comment: ""), style: .cancel, handler: nil))
|
|
|
+
|
|
|
+ alert.addTextField(configurationHandler: { textField in
|
|
|
+ textField.placeholder = "http://myserver.com/movie.mkv"
|
|
|
+ })
|
|
|
+
|
|
|
+ alert.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { _ in
|
|
|
+ guard let stringUrl = alert.textFields?.first?.text, !stringUrl.isEmpty, let url = URL(string: stringUrl) else { return }
|
|
|
+ let fileName = url.lastPathComponent
|
|
|
+ let metadata = NCManageDatabase.shared.createMetadata(account: self.appDelegate.account, user: self.appDelegate.user, userId: self.appDelegate.userId, fileName: fileName, fileNameView: fileName, ocId: NSUUID().uuidString, serverUrl: "", urlBase: self.appDelegate.urlBase, url: stringUrl, contentType: "")
|
|
|
+ NCManageDatabase.shared.addMetadata(metadata)
|
|
|
+ NCViewer.shared.view(viewController: self, metadata: metadata, metadatas: [metadata], imageIcon: nil)
|
|
|
+ }))
|
|
|
+
|
|
|
+ self.present(alert, animated: true)
|
|
|
+
|
|
|
+ }
|
|
|
+ )
|
|
|
+ )
|
|
|
+
|
|
|
actions.append(.seperator(order: 0))
|
|
|
|
|
|
actions.append(
|