Commit f16b49e9 authored by 朱璇's avatar 朱璇

fix 资源文件获取不到的问题

parent 0d4f10ee
...@@ -57,7 +57,7 @@ TODO: Add long description of the pod here. ...@@ -57,7 +57,7 @@ TODO: Add long description of the pod here.
# end # end
s.resource_bundles = { s.resource_bundles = {
'GMAILab' => ['GMAILab/Assets/*.{png,xib}'] 'GMAILab' => ['GMAILab/Assets/*.{png,xib,webp,mp3}']
} }
# s.public_header_files = 'Pod/Classes/**/*.h' # s.public_header_files = 'Pod/Classes/**/*.h'
......
...@@ -78,7 +78,7 @@ static GMDoctorVideoTelephoneLogin *loginManager = nil; ...@@ -78,7 +78,7 @@ static GMDoctorVideoTelephoneLogin *loginManager = nil;
_extensionDict = extentsionDict; _extensionDict = extentsionDict;
_clientRole = TTTRtc_ClientRole_Broadcaster; _clientRole = TTTRtc_ClientRole_Broadcaster;
TTManager.telephoneStatus = TelephoneVideoStatus_wating; TTManager.telephoneStatus = TelephoneVideoStatus_wating;
_audioPlay = [[GMTelephoneAudioPlay alloc] initWithAudioSource:@"videoTelephone" ofType:@"mp3"]; _audioPlay = [[GMTelephoneAudioPlay alloc] initWithAudioSource:@"videoTelephone" ofType:@".mp3"];
[GMVideoTelephoneRequestTool doctorVideoTelephoneMessage:messageDict finishBlock:^(BOOL success, NSDictionary *modelDict, NSString *errorMessage) { [GMVideoTelephoneRequestTool doctorVideoTelephoneMessage:messageDict finishBlock:^(BOOL success, NSDictionary *modelDict, NSString *errorMessage) {
if (success) { if (success) {
[[[UIApplication sharedApplication] keyWindow] endEditing:YES]; [[[UIApplication sharedApplication] keyWindow] endEditing:YES];
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#import "GMTelephoneAudioPlay.h" #import "GMTelephoneAudioPlay.h"
#import <AVFoundation/AVFoundation.h> #import <AVFoundation/AVFoundation.h>
#import <AudioToolbox/AudioToolbox.h> #import <AudioToolbox/AudioToolbox.h>
#import "NSBundle+GMAILab.h"
@interface GMTelephoneAudioPlay () @interface GMTelephoneAudioPlay ()
@property (nonatomic, strong) AVAudioPlayer *audioPlay; @property (nonatomic, strong) AVAudioPlayer *audioPlay;
...@@ -18,8 +19,8 @@ ...@@ -18,8 +19,8 @@
- (GMTelephoneAudioPlay *)initWithAudioSource:(NSString *)name ofType:(nonnull NSString *)type{ - (GMTelephoneAudioPlay *)initWithAudioSource:(NSString *)name ofType:(nonnull NSString *)type{
self = [super init]; self = [super init];
if (self) { if (self) {
NSString *soundPath = [[NSBundle mainBundle] pathForResource:name ofType:type]; NSString *soundPath = [[NSBundle gm_AILabBundle:[self class]] pathForResource:name ofType:type];
NSURL *soundUrl = [NSURL fileURLWithPath:soundPath]; NSURL *soundUrl = [NSURL fileURLWithPath:soundPath ? soundPath : @""];
//初始化播放器对象 //初始化播放器对象
self.audioPlay = [[AVAudioPlayer alloc]initWithContentsOfURL:soundUrl error:nil]; self.audioPlay = [[AVAudioPlayer alloc]initWithContentsOfURL:soundUrl error:nil];
//设置声音的大小 //设置声音的大小
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
userFrame = self.bounds; userFrame = self.bounds;
doctorFrame = CGRectMake(MAINSCREEN_WIDTH - width - 4, OCNavigationBar.barHeight + 25, width, heigh); doctorFrame = CGRectMake(MAINSCREEN_WIDTH - width - 4, OCNavigationBar.barHeight + 25, width, heigh);
self.windowStatu = YES; self.windowStatu = YES;
_audioPlay = [[GMTelephoneAudioPlay alloc] initWithAudioSource:@"videoTelephone" ofType:@"mp3"]; _audioPlay = [[GMTelephoneAudioPlay alloc] initWithAudioSource:@"videoTelephone" ofType:@".mp3"];
[_audioPlay startAudioPlay]; [_audioPlay startAudioPlay];
}else { }else {
doctorFrame = self.bounds; doctorFrame = self.bounds;
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#import "GMLibraryHeader.h" #import "GMLibraryHeader.h"
#import <GMBase/GMBaseTool.h> #import <GMBase/GMBaseTool.h>
#import "NSBundle+GMAILab.h"
#define centerPoint CGPointMake(MAINSCREEN_WIDTH / 2, MAINSCREEN_HEIGHT / 2) #define centerPoint CGPointMake(MAINSCREEN_WIDTH / 2, MAINSCREEN_HEIGHT / 2)
#define circleAnimaitionTime 2 #define circleAnimaitionTime 2
...@@ -305,7 +306,7 @@ ...@@ -305,7 +306,7 @@
_animationView.runLoopMode = NSDefaultRunLoopMode; _animationView.runLoopMode = NSDefaultRunLoopMode;
_animationView.frame = CGRectMake(0, 78, MAINSCREEN_WIDTH, 212); _animationView.frame = CGRectMake(0, 78, MAINSCREEN_WIDTH, 212);
_animationView.centerX = centerPoint.x; _animationView.centerX = centerPoint.x;
NSString *path = [[NSBundle mainBundle] pathForResource:@"waiting_loading.webp" ofType:nil]; NSString *path = [[NSBundle gm_AILabBundle:[self class]] pathForResource:@"waiting_loading" ofType:@"webp"];
NSData *data = [[NSData alloc] initWithContentsOfFile:path]; NSData *data = [[NSData alloc] initWithContentsOfFile:path];
UIImage *img = [UIImage sd_imageWithData:data]; UIImage *img = [UIImage sd_imageWithData:data];
_animationView.image = img; _animationView.image = img;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment