Commit 4d334013e3950dc1a635aa03f4cbe205411b02ae
1 parent
b5376d0f
Exists in
IosBuild
Finish IOS
Showing
2 changed files
with
4 additions
and
27 deletions
Show diff stats
Assets/Plugins/IOS/iOSNativeShare.m
| @@ -50,22 +50,11 @@ extern UIViewController* UnityGetGLViewController(); | @@ -50,22 +50,11 @@ extern UIViewController* UnityGetGLViewController(); | ||
| 50 | void SendToGallery(NSString *path){ | 50 | void SendToGallery(NSString *path){ |
| 51 | if(UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(path)){ | 51 | if(UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(path)){ |
| 52 | //UISaveVideoAtPathToSavedPhotosAlbum (path,self, nil, nil); | 52 | //UISaveVideoAtPathToSavedPhotosAlbum (path,self, nil, nil); |
| 53 | - UISaveVideoAtPathToSavedPhotosAlbum (path,self, @selector(video:didFinishSavingWithError:contextInfo:), nil); | 53 | + UISaveVideoAtPathToSavedPhotosAlbum (path,nil, nil, nil); |
| 54 | //ShowAlertMessage(@"Vlibras Vídeo",@"Video salvo na galeria."); | 54 | //ShowAlertMessage(@"Vlibras Vídeo",@"Video salvo na galeria."); |
| 55 | } | 55 | } |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | -- (void)video:(NSString*)videoPath didFinishSavingWithError:(NSError*)error contextInfo:(void*)contextInfo | ||
| 59 | -{ | ||
| 60 | - if (error) | ||
| 61 | - { | ||
| 62 | - ShowAlertMessage(@"Vlibras Vídeo",@"Error ao salvar vídeo."); | ||
| 63 | - } | ||
| 64 | - else | ||
| 65 | - { | ||
| 66 | - ShowAlertMessage(@"Vlibras Vídeo",@"Video salvo na galeria."); | ||
| 67 | - } | ||
| 68 | -} | ||
| 69 | 58 | ||
| 70 | void ShowAlertMessage (NSString *title, NSString *message){ | 59 | void ShowAlertMessage (NSString *title, NSString *message){ |
| 71 | 60 | ||
| @@ -161,15 +150,6 @@ void ShowAlertMessage (NSString *title, NSString *message){ | @@ -161,15 +150,6 @@ void ShowAlertMessage (NSString *title, NSString *message){ | ||
| 161 | return self; | 150 | return self; |
| 162 | } | 151 | } |
| 163 | 152 | ||
| 164 | --(BOOL) isStringValideBase64:(NSString*)string{ | ||
| 165 | - | ||
| 166 | - NSString regExPattern = @"^(?:[A-Za-z0-9+/]{4})(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"; | ||
| 167 | - | ||
| 168 | - NSRegularExpression *regEx = [[NSRegularExpression alloc] initWithPattern:regExPattern options:NSRegularExpressionCaseInsensitive error:nil]; | ||
| 169 | - NSUInteger regExMatches = [regEx numberOfMatchesInString:string options:0 range:NSMakeRange(0, [string length])]; | ||
| 170 | - return regExMatches != 0; | ||
| 171 | -} | ||
| 172 | - | ||
| 173 | # pragma mark - C API | 153 | # pragma mark - C API |
| 174 | iOSNativeShare* instance; | 154 | iOSNativeShare* instance; |
| 175 | 155 |
Assets/Scripts/Export Video/MediaShareIOS.cs
| @@ -53,7 +53,7 @@ public class MediaShareIOS : MonoBehaviour { | @@ -53,7 +53,7 @@ public class MediaShareIOS : MonoBehaviour { | ||
| 53 | SourceStream.Write(videoContent, 0, bytes); | 53 | SourceStream.Write(videoContent, 0, bytes); |
| 54 | SourceStream.Close(); | 54 | SourceStream.Close(); |
| 55 | ShareIOS.CallSendToGallery(Path.Combine(path,FilePath)); | 55 | ShareIOS.CallSendToGallery(Path.Combine(path,FilePath)); |
| 56 | - yield return new WaitForSeconds(0.5f); | 56 | + yield return new WaitForSeconds(1.0f); |
| 57 | 57 | ||
| 58 | finishWriting(); | 58 | finishWriting(); |
| 59 | 59 | ||
| @@ -62,13 +62,10 @@ public class MediaShareIOS : MonoBehaviour { | @@ -62,13 +62,10 @@ public class MediaShareIOS : MonoBehaviour { | ||
| 62 | } | 62 | } |
| 63 | else | 63 | else |
| 64 | { | 64 | { |
| 65 | - // new AndroidToast().showToast("Erro ao salvar vídeo.", "LONG"); | 65 | + |
| 66 | 66 | ||
| 67 | errorWriting(); | 67 | errorWriting(); |
| 68 | - } | ||
| 69 | - | ||
| 70 | - | ||
| 71 | - | 68 | + } |
| 72 | 69 | ||
| 73 | 70 | ||
| 74 | yield break; | 71 | yield break; |