Skip to content
Snippets Groups Projects
Commit a1b42789 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk
Browse files

call: enable streaming from file

Change-Id: I8f75e454560d81816e4083d65e918f537a64ca01
parent 43de2e25
Branches
No related tags found
No related merge requests found
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
-(void) mouseIsMoving:(BOOL) move; -(void) mouseIsMoving:(BOOL) move;
-(void) screenShare; -(void) screenShare;
-(void) switchToDevice:(int)deviceID; -(void) switchToDevice:(int)deviceID;
-(void) switchToFile:(std::string)uri; -(void) switchToFile:(QString)uri;
-(QVector<QString>) getDeviceList; -(QVector<QString>) getDeviceList;
-(NSString *) getDefaultDeviceName; -(NSString *) getDefaultDeviceName;
......
...@@ -149,8 +149,7 @@ NSString *currentDevice; ...@@ -149,8 +149,7 @@ NSString *currentDevice;
//check to see if we can accept the data //check to see if we can accept the data
return conforms; return conforms;
} }
#if 0
// TODO: add file as a source
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{ {
/*------------------------------------------------------ /*------------------------------------------------------
...@@ -158,17 +157,12 @@ NSString *currentDevice; ...@@ -158,17 +157,12 @@ NSString *currentDevice;
--------------------------------------------------------*/ --------------------------------------------------------*/
if ( [sender draggingSource] != self ) { if ( [sender draggingSource] != self ) {
NSURL* fileURL = [NSURL URLFromPasteboard: [sender draggingPasteboard]]; NSURL* fileURL = [NSURL URLFromPasteboard: [sender draggingPasteboard]];
Call* call = [self getCurrentCall]; auto name = QString::fromNSString([@"file:///" stringByAppendingString: fileURL.path]);
if (call == nullptr) return; [self.callDelegate switchToFile: name];
if (auto outVideo = call->firstMedia<media::Video>(media::Media::Direction::OUT)) {
outVideo->sourceModel()->setFile(QUrl::fromLocalFile(QString::fromUtf8([fileURL.path UTF8String])));
return YES; return YES;
} }
}
return NO; return NO;
} }
#endif
- (void)showContextualMenu:(NSEvent *)theEvent { - (void)showContextualMenu:(NSEvent *)theEvent {
...@@ -186,14 +180,13 @@ NSString *currentDevice; ...@@ -186,14 +180,13 @@ NSString *currentDevice;
action:@selector(captureScreen:) action:@selector(captureScreen:)
keyEquivalent:@"" keyEquivalent:@""
atIndex:contextualMenu.itemArray.count]; atIndex:contextualMenu.itemArray.count];
#if 0
// TODO: add file as a source
[contextualMenu addItem:[NSMenuItem separatorItem]]; [contextualMenu addItem:[NSMenuItem separatorItem]];
[contextualMenu insertItemWithTitle:NSLocalizedString(@"Choose file", @"Contextual menu entry") [contextualMenu insertItemWithTitle:NSLocalizedString(@"Choose file", @"Contextual menu entry")
action:@selector(chooseFile:) action:@selector(chooseFile:)
keyEquivalent:@"" keyEquivalent:@""
atIndex:contextualMenu.itemArray.count]; atIndex:contextualMenu.itemArray.count];
#endif
auto menuItem = [contextualMenu itemWithTitle:currentDevice]; auto menuItem = [contextualMenu itemWithTitle:currentDevice];
if(menuItem) { if(menuItem) {
...@@ -270,7 +263,8 @@ NSString *currentDevice; ...@@ -270,7 +263,8 @@ NSString *currentDevice;
[browsePanel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger result) { [browsePanel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger result) {
if (result == NSFileHandlingPanelOKButton) { if (result == NSFileHandlingPanelOKButton) {
NSURL* theDoc = [[browsePanel URLs] objectAtIndex:0]; NSURL* theDoc = [[browsePanel URLs] objectAtIndex:0];
[self.callDelegate switchToFile: [theDoc.path UTF8String]]; auto name = QString::fromNSString([@"file:///" stringByAppendingString: theDoc.path]);
[self.callDelegate switchToFile: name];
} }
}]; }];
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment