12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- //
- // YMAudioPlayer.h
- // MSYOUPAI
- //
- // Created by YoMi on 2024/2/25.
- // Copyright © 2024 MS. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- #import "FSAudioStream.h"
- #define kAudioPlayer [YMAudioPlayer sharedInstance]
- @class YMAudioPlayer;
- @protocol YMAudioPlayerDelegate <NSObject>
- @optional
- - (void)audioPlayerDidPlayMusicCompleted;
- - (void)audioPlayer:(YMAudioPlayer *)player stateChangeWithState:(FSAudioStreamState)state;
- @end
- @interface YMAudioPlayer : NSObject
- + (instancetype)sharedInstance;
- /** 代理 */
- @property (nonatomic, weak) id<YMAudioPlayerDelegate> delegate;
- /** 播放地址 */
- @property (nonatomic, copy) NSString *playUrlStr;
- /** 播放状态 */
- @property (nonatomic, readonly) FSAudioStreamState state;
- /** 播放进度 */
- @property (nonatomic, assign) float progress;
- /** AudioStream 播放器 */
- @property (nonatomic, strong) FSAudioStream *audioStream;
- /** 播放 */
- - (void)play;
- /** 暂停 */
- - (void)pause;
- /** 恢复播放 */
- - (void)resume;
- /** 停止播放 */
- - (void)stop;
- @end
|