mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-27 07:59:20 +00:00
add *addvideo* button
This commit is contained in:
parent
8e2ebf38dd
commit
70b09a2694
9 changed files with 337 additions and 8 deletions
|
|
@ -34,6 +34,7 @@
|
|||
UIButton* pause;
|
||||
UISpeakerButton* speaker;
|
||||
UIButton* contacts;
|
||||
UIButton* addVideo;
|
||||
UITableView* callTableView;
|
||||
UIButton* addCall, *mergeCalls, *addToConf;
|
||||
|
||||
|
|
@ -89,6 +90,7 @@
|
|||
@property (nonatomic, retain) IBOutlet UIButton* pause;
|
||||
@property (nonatomic, retain) IBOutlet UIButton* speaker;
|
||||
@property (nonatomic, retain) IBOutlet UIButton* contacts;
|
||||
@property (nonatomic, retain) IBOutlet UIButton* addVideo;
|
||||
@property (nonatomic, retain) IBOutlet UITableView* callTableView;
|
||||
@property (nonatomic, retain) IBOutlet UIButton* addCall;
|
||||
@property (nonatomic, retain) IBOutlet UIButton* mergeCalls;
|
||||
|
|
|
|||
|
|
@ -184,6 +184,24 @@ int callCount(LinphoneCore* lc) {
|
|||
withDisplayName:nil];
|
||||
|
||||
}
|
||||
|
||||
|
||||
UIDevice* device = [UIDevice currentDevice];
|
||||
if ([device respondsToSelector:@selector(isMultitaskingSupported)]
|
||||
&& [device isMultitaskingSupported]) {
|
||||
bool enableVideo = [[NSUserDefaults standardUserDefaults] boolForKey:@"enable_video_preference"];
|
||||
bool startVideo = [[NSUserDefaults standardUserDefaults] boolForKey:@"start_video_preference"];
|
||||
if (enableVideo && !startVideo) {
|
||||
[addVideo setHidden:FALSE];
|
||||
[contacts setHidden:TRUE];
|
||||
} else {
|
||||
[addVideo setHidden:TRUE];
|
||||
[contacts setHidden:FALSE];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@
|
|||
<string key="NSFrame">{{107, 70}, {106, 66}}</string>
|
||||
<reference key="NSSuperview" ref="585669622"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="478667533"/>
|
||||
<reference key="NSNextKeyView" ref="603015724"/>
|
||||
<reference key="IBUIBackgroundColor" ref="95762599"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
|
|
@ -215,7 +215,7 @@
|
|||
<string key="NSFrame">{{0, 70}, {107, 66}}</string>
|
||||
<reference key="NSSuperview" ref="585669622"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="603015724"/>
|
||||
<reference key="NSNextKeyView" ref="1031005817"/>
|
||||
<reference key="IBUIBackgroundColor" ref="95762599"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
|
|
@ -241,7 +241,7 @@
|
|||
<string key="NSFrame">{{213, 70}, {107, 66}}</string>
|
||||
<reference key="NSSuperview" ref="585669622"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="30856702"/>
|
||||
<reference key="NSNextKeyView" ref="481206195"/>
|
||||
<reference key="IBUIBackgroundColor" ref="95762599"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
|
|
@ -264,6 +264,29 @@
|
|||
<reference key="IBUIFontDescription" ref="974614377"/>
|
||||
<reference key="IBUIFont" ref="773313654"/>
|
||||
</object>
|
||||
<object class="IBUIButton" id="481206195">
|
||||
<reference key="NSNextResponder" ref="585669622"/>
|
||||
<int key="NSvFlags">-2147483356</int>
|
||||
<string key="NSFrame">{{213, 70}, {107, 66}}</string>
|
||||
<reference key="NSSuperview" ref="585669622"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="30856702"/>
|
||||
<reference key="IBUIBackgroundColor" ref="95762599"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<string key="IBUINormalTitle">video</string>
|
||||
<reference key="IBUIHighlightedTitleColor" ref="816037173"/>
|
||||
<object class="NSColor" key="IBUINormalTitleColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA</bytes>
|
||||
</object>
|
||||
<reference key="IBUINormalTitleShadowColor" ref="920781842"/>
|
||||
<reference key="IBUIFontDescription" ref="974614377"/>
|
||||
<reference key="IBUIFont" ref="773313654"/>
|
||||
</object>
|
||||
<object class="IBUIButton" id="752456321">
|
||||
<reference key="NSNextResponder" ref="585669622"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
|
|
@ -326,7 +349,7 @@
|
|||
<string key="NSFrame">{{107, 70}, {106, 66}}</string>
|
||||
<reference key="NSSuperview" ref="585669622"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="1031005817"/>
|
||||
<reference key="NSNextKeyView" ref="478667533"/>
|
||||
<reference key="IBUIBackgroundColor" ref="95762599"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
|
|
@ -908,6 +931,14 @@
|
|||
</object>
|
||||
<int key="connectionID">114</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">addVideo</string>
|
||||
<reference key="source" ref="841351856"/>
|
||||
<reference key="destination" ref="481206195"/>
|
||||
</object>
|
||||
<int key="connectionID">125</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">doAction:</string>
|
||||
|
|
@ -1127,6 +1158,7 @@
|
|||
<reference ref="297000325"/>
|
||||
<reference ref="861550739"/>
|
||||
<reference ref="1031005817"/>
|
||||
<reference ref="481206195"/>
|
||||
</object>
|
||||
<reference key="parent" ref="858247959"/>
|
||||
<string key="objectName">controls</string>
|
||||
|
|
@ -1173,6 +1205,12 @@
|
|||
<reference key="parent" ref="585669622"/>
|
||||
<string key="objectName">merge</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">123</int>
|
||||
<reference key="object" ref="481206195"/>
|
||||
<reference key="parent" ref="585669622"/>
|
||||
<string key="objectName">video</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
|
|
@ -1191,6 +1229,8 @@
|
|||
<string>113.IBPluginDependency</string>
|
||||
<string>113.IBUIButtonInspectorSelectedStateConfigurationMetadataKey</string>
|
||||
<string>120.IBPluginDependency</string>
|
||||
<string>123.CustomClassName</string>
|
||||
<string>123.IBPluginDependency</string>
|
||||
<string>13.CustomClassName</string>
|
||||
<string>13.IBPluginDependency</string>
|
||||
<string>13.IBUIButtonInspectorSelectedStateConfigurationMetadataKey</string>
|
||||
|
|
@ -1245,6 +1285,8 @@
|
|||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<real value="0.0"/>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>UIAddVideoButton</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>UISpeakerButton</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<real value="2"/>
|
||||
|
|
@ -1298,7 +1340,7 @@
|
|||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">122</int>
|
||||
<int key="maxID">125</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
|
|
@ -1323,6 +1365,7 @@
|
|||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>addCall</string>
|
||||
<string>addToConf</string>
|
||||
<string>addVideo</string>
|
||||
<string>callControlSubView</string>
|
||||
<string>callTableView</string>
|
||||
<string>close</string>
|
||||
|
|
@ -1347,12 +1390,14 @@
|
|||
<string>star</string>
|
||||
<string>three</string>
|
||||
<string>two</string>
|
||||
<string>videoViewController</string>
|
||||
<string>zero</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>UIButton</string>
|
||||
<string>UIButton</string>
|
||||
<string>UIButton</string>
|
||||
<string>UIView</string>
|
||||
<string>UITableView</string>
|
||||
<string>UIButton</string>
|
||||
|
|
@ -1377,6 +1422,7 @@
|
|||
<string>UIButton</string>
|
||||
<string>UIButton</string>
|
||||
<string>UIButton</string>
|
||||
<string>VideoViewController</string>
|
||||
<string>UIButton</string>
|
||||
</object>
|
||||
</object>
|
||||
|
|
@ -1386,6 +1432,7 @@
|
|||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>addCall</string>
|
||||
<string>addToConf</string>
|
||||
<string>addVideo</string>
|
||||
<string>callControlSubView</string>
|
||||
<string>callTableView</string>
|
||||
<string>close</string>
|
||||
|
|
@ -1410,6 +1457,7 @@
|
|||
<string>star</string>
|
||||
<string>three</string>
|
||||
<string>two</string>
|
||||
<string>videoViewController</string>
|
||||
<string>zero</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
|
|
@ -1422,6 +1470,10 @@
|
|||
<string key="name">addToConf</string>
|
||||
<string key="candidateClassName">UIButton</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">addVideo</string>
|
||||
<string key="candidateClassName">UIButton</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">callControlSubView</string>
|
||||
<string key="candidateClassName">UIView</string>
|
||||
|
|
@ -1518,6 +1570,10 @@
|
|||
<string key="name">two</string>
|
||||
<string key="candidateClassName">UIButton</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">videoViewController</string>
|
||||
<string key="candidateClassName">VideoViewController</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">zero</string>
|
||||
<string key="candidateClassName">UIButton</string>
|
||||
|
|
@ -1529,6 +1585,33 @@
|
|||
<string key="minorKey">./Classes/IncallViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIAddVideoButton</string>
|
||||
<string key="superclassName">UIButton</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/UIAddVideoButton.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UICamSwitch</string>
|
||||
<string key="superclassName">UIButton</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">preview</string>
|
||||
<string key="NS.object.0">UIView</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<string key="NS.key.0">preview</string>
|
||||
<object class="IBToOneOutletInfo" key="NS.object.0">
|
||||
<string key="name">preview</string>
|
||||
<string key="candidateClassName">UIView</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/UICamSwitch.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIDigitButton</string>
|
||||
<string key="superclassName">UIButton</string>
|
||||
|
|
@ -1537,6 +1620,14 @@
|
|||
<string key="minorKey">./Classes/UIDigitButton.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIHangUpButton</string>
|
||||
<string key="superclassName">UIButton</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/UIHangUpButton.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIMuteButton</string>
|
||||
<string key="superclassName">UIToggleButton</string>
|
||||
|
|
@ -1561,6 +1652,116 @@
|
|||
<string key="minorKey">./Classes/UIToggleButton.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">VideoViewController</string>
|
||||
<string key="superclassName">UIViewController</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>mCamSwitch</string>
|
||||
<string>mCamSwitchLand</string>
|
||||
<string>mDisplay</string>
|
||||
<string>mDisplayLand</string>
|
||||
<string>mHangUp</string>
|
||||
<string>mHangUpLand</string>
|
||||
<string>mLandscape</string>
|
||||
<string>mMute</string>
|
||||
<string>mMuteLand</string>
|
||||
<string>mPortrait</string>
|
||||
<string>mPreview</string>
|
||||
<string>mPreviewLand</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>UICamSwitch</string>
|
||||
<string>UICamSwitch</string>
|
||||
<string>UIView</string>
|
||||
<string>UIView</string>
|
||||
<string>UIHangUpButton</string>
|
||||
<string>UIHangUpButton</string>
|
||||
<string>UIView</string>
|
||||
<string>UIMuteButton</string>
|
||||
<string>UIMuteButton</string>
|
||||
<string>UIView</string>
|
||||
<string>UIView</string>
|
||||
<string>UIView</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>mCamSwitch</string>
|
||||
<string>mCamSwitchLand</string>
|
||||
<string>mDisplay</string>
|
||||
<string>mDisplayLand</string>
|
||||
<string>mHangUp</string>
|
||||
<string>mHangUpLand</string>
|
||||
<string>mLandscape</string>
|
||||
<string>mMute</string>
|
||||
<string>mMuteLand</string>
|
||||
<string>mPortrait</string>
|
||||
<string>mPreview</string>
|
||||
<string>mPreviewLand</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">mCamSwitch</string>
|
||||
<string key="candidateClassName">UICamSwitch</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">mCamSwitchLand</string>
|
||||
<string key="candidateClassName">UICamSwitch</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">mDisplay</string>
|
||||
<string key="candidateClassName">UIView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">mDisplayLand</string>
|
||||
<string key="candidateClassName">UIView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">mHangUp</string>
|
||||
<string key="candidateClassName">UIHangUpButton</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">mHangUpLand</string>
|
||||
<string key="candidateClassName">UIHangUpButton</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">mLandscape</string>
|
||||
<string key="candidateClassName">UIView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">mMute</string>
|
||||
<string key="candidateClassName">UIMuteButton</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">mMuteLand</string>
|
||||
<string key="candidateClassName">UIMuteButton</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">mPortrait</string>
|
||||
<string key="candidateClassName">UIView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">mPreview</string>
|
||||
<string key="candidateClassName">UIView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">mPreviewLand</string>
|
||||
<string key="candidateClassName">UIView</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/VideoViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
|
|
@ -1604,7 +1805,7 @@
|
|||
<string>{82, 75}</string>
|
||||
<string>{164, 104}</string>
|
||||
<string>{164, 104}</string>
|
||||
<string>{82, 82}</string>
|
||||
<string>{20, 20}</string>
|
||||
<string>{164, 104}</string>
|
||||
<string>{164, 104}</string>
|
||||
<string>{164, 104}</string>
|
||||
|
|
|
|||
|
|
@ -560,6 +560,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
|
|||
|
||||
bool enableVideo = [[NSUserDefaults standardUserDefaults] boolForKey:@"enable_video_preference"];
|
||||
linphone_core_enable_video(theLinphoneCore, enableVideo, enableVideo);
|
||||
|
||||
bool enableSrtp = [[NSUserDefaults standardUserDefaults] boolForKey:@"enable_srtp_preference"];
|
||||
linphone_core_set_media_encryption(theLinphoneCore, enableSrtp?LinphoneMediaEncryptionSRTP:LinphoneMediaEncryptionNone);
|
||||
|
||||
|
|
|
|||
24
Classes/LinphoneUI/UIAddVideoButton.h
Normal file
24
Classes/LinphoneUI/UIAddVideoButton.h
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/* UIAddVideoButton.h
|
||||
*
|
||||
* Copyright (C) 2011 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface UIAddVideoButton : UIButton
|
||||
- (id)initWithCoder:(NSCoder *)decoder;
|
||||
@end
|
||||
58
Classes/LinphoneUI/UIAddVideoButton.m
Normal file
58
Classes/LinphoneUI/UIAddVideoButton.m
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
/* UIAddVideoButton.m
|
||||
*
|
||||
* Copyright (C) 2011 Belledonne Comunications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "UIAddVideoButton.h"
|
||||
#include "LinphoneManager.h"
|
||||
|
||||
@implementation UIAddVideoButton
|
||||
|
||||
-(void) touchUp:(id) sender {
|
||||
LinphoneCore* lc = [LinphoneManager getLc];
|
||||
LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]);
|
||||
if (call) {
|
||||
LinphoneCallParams* call_params = linphone_call_params_copy(linphone_call_get_current_params(call));
|
||||
linphone_call_params_enable_video(call_params, TRUE);
|
||||
linphone_core_update_call(lc, call, call_params);
|
||||
linphone_call_params_destroy(call_params);
|
||||
} {
|
||||
ms_warning("Cannot add video, because no current call");
|
||||
}
|
||||
}
|
||||
|
||||
- (id) init {
|
||||
[self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside];
|
||||
return self;
|
||||
}
|
||||
- (id)initWithFrame:(CGRect)frame {
|
||||
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self init];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
- (id)initWithCoder:(NSCoder *)decoder {
|
||||
self = [super initWithCoder:decoder];
|
||||
if (self) {
|
||||
[self init];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -36,10 +36,12 @@
|
|||
LinphoneProxyConfig* proxyCfg;
|
||||
//get default proxy
|
||||
linphone_core_get_default_proxy([LinphoneManager getLc],&proxyCfg);
|
||||
bool startVideo = [[NSUserDefaults standardUserDefaults] boolForKey:@"start_video_preference"];
|
||||
LinphoneCallParams* lcallParams = linphone_core_create_default_call_parameters([LinphoneManager getLc]);
|
||||
|
||||
if ([mAddress.text length] == 0) return; //just return
|
||||
if ([mAddress.text hasPrefix:@"sip:"]) {
|
||||
linphone_core_invite([LinphoneManager getLc], [mAddress.text cStringUsingEncoding:[NSString defaultCStringEncoding]]);
|
||||
linphone_core_invite_with_params([LinphoneManager getLc],[mAddress.text cStringUsingEncoding:[NSString defaultCStringEncoding]],lcallParams);
|
||||
} else if ( proxyCfg==nil){
|
||||
UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Invalid sip address",nil)
|
||||
message:NSLocalizedString(@"Either configure a SIP proxy server from settings prior to place a call or use a valid sip address (I.E sip:john@example.net)",nil)
|
||||
|
|
@ -61,9 +63,14 @@
|
|||
LinphoneAddress* tmpAddress = linphone_address_new(linphone_core_get_identity([LinphoneManager getLc]));
|
||||
linphone_address_set_username(tmpAddress,normalizedUserName);
|
||||
linphone_address_set_display_name(tmpAddress,[mDisplayName.text length]>0?[mDisplayName.text cStringUsingEncoding:[NSString defaultCStringEncoding]]:nil);
|
||||
linphone_core_invite([LinphoneManager getLc],linphone_address_as_string(tmpAddress)) ;
|
||||
|
||||
|
||||
linphone_call_params_enable_video(lcallParams,startVideo);
|
||||
linphone_core_invite_address_with_params([LinphoneManager getLc],tmpAddress,lcallParams) ;
|
||||
|
||||
linphone_address_destroy(tmpAddress);
|
||||
}
|
||||
linphone_call_params_destroy(lcallParams);
|
||||
} else if (linphone_core_inc_invite_pending([LinphoneManager getLc])) {
|
||||
linphone_core_accept_call([LinphoneManager getLc],linphone_core_get_current_call([LinphoneManager getLc]));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,16 @@
|
|||
<key>DefaultValue</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>Automatically start video</string>
|
||||
<key>Key</key>
|
||||
<string>start_video_preference</string>
|
||||
<key>DefaultValue</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Title</key>
|
||||
<string>Codecs</string>
|
||||
|
|
|
|||
|
|
@ -114,6 +114,8 @@
|
|||
22BB1A69132FF16A005CD7AA /* UIEraseButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 22BB1A68132FF16A005CD7AA /* UIEraseButton.m */; };
|
||||
22C755601317E59C007BC101 /* UIBluetoothButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 22C7555F1317E59C007BC101 /* UIBluetoothButton.m */; };
|
||||
22D1B68112A3E0BE001AE361 /* libresolv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 22D1B68012A3E0BE001AE361 /* libresolv.dylib */; };
|
||||
22D817AD147A9F33001CFB9C /* UIAddVideoButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 22D817AC147A9F33001CFB9C /* UIAddVideoButton.m */; };
|
||||
22D817AE147A9F33001CFB9C /* UIAddVideoButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 22D817AC147A9F33001CFB9C /* UIAddVideoButton.m */; };
|
||||
22D8F11F147548E2008C97DB /* linphonerc in Resources */ = {isa = PBXBuildFile; fileRef = 2274550710700509006EC466 /* linphonerc */; };
|
||||
22D8F120147548E2008C97DB /* PhoneViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22F2508D107141E100AC9B3F /* PhoneViewController.xib */; };
|
||||
22D8F121147548E2008C97DB /* ringback.wav in Resources */ = {isa = PBXBuildFile; fileRef = 22F254801073D99800AC9B3F /* ringback.wav */; };
|
||||
|
|
@ -547,6 +549,8 @@
|
|||
22C7564A13265C6A007BC101 /* x509_vfy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = x509_vfy.h; sourceTree = "<group>"; };
|
||||
22C7564B13265C6A007BC101 /* x509v3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = x509v3.h; sourceTree = "<group>"; };
|
||||
22D1B68012A3E0BE001AE361 /* libresolv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libresolv.dylib; path = usr/lib/libresolv.dylib; sourceTree = SDKROOT; };
|
||||
22D817AB147A9F33001CFB9C /* UIAddVideoButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIAddVideoButton.h; sourceTree = "<group>"; };
|
||||
22D817AC147A9F33001CFB9C /* UIAddVideoButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIAddVideoButton.m; sourceTree = "<group>"; };
|
||||
22D8F187147548E2008C97DB /* linphone-no-gpl-thirdparties.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "linphone-no-gpl-thirdparties.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
22D8F189147548E3008C97DB /* linphone copy-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "linphone copy-Info.plist"; path = "/Users/jehanmonnier/workspaces/workspace-iphone-port/linphone-iphone/linphone copy-Info.plist"; sourceTree = "<absolute>"; };
|
||||
22E028B413B4CCBD0068A713 /* VideoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoViewController.h; sourceTree = "<group>"; };
|
||||
|
|
@ -947,6 +951,8 @@
|
|||
223963161393CFAF001DE689 /* FastAddressBook.m */,
|
||||
22AA8AFF13D83F6300B30535 /* UICamSwitch.h */,
|
||||
22AA8B0013D83F6300B30535 /* UICamSwitch.m */,
|
||||
22D817AB147A9F33001CFB9C /* UIAddVideoButton.h */,
|
||||
22D817AC147A9F33001CFB9C /* UIAddVideoButton.m */,
|
||||
);
|
||||
path = LinphoneUI;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -1357,6 +1363,7 @@
|
|||
2211DBBC14769C8300DEE054 /* AdvancedPhoneViewController.m in Sources */,
|
||||
2211DBBE14769C8300DEE054 /* CallDelegate.m in Sources */,
|
||||
2211DBC014769CB200DEE054 /* IncallViewController.m in Sources */,
|
||||
22D817AD147A9F33001CFB9C /* UIAddVideoButton.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
@ -1389,6 +1396,7 @@
|
|||
2211DBBD14769C8300DEE054 /* AdvancedPhoneViewController.m in Sources */,
|
||||
2211DBBF14769C8300DEE054 /* CallDelegate.m in Sources */,
|
||||
2211DBC114769CB300DEE054 /* IncallViewController.m in Sources */,
|
||||
22D817AE147A9F33001CFB9C /* UIAddVideoButton.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue