99#import < Foundation/Foundation.h>
1010#import < UIKit/UIKit.h>
1111
12+ /* *
13+ The current state of the media view.
14+ */
1215typedef NS_ENUM (NSInteger , QMMediaViewState) {
16+ /* * Default view state.*/
1317 QMMediaViewStateNotReady,
18+ /* * The view is ready to play.*/
1419 QMMediaViewStateReady,
20+ /* * The view's model is loading.*/
1521 QMMediaViewStateLoading,
22+ /* * The view is playing.*/
1623 QMMediaViewStateActive,
24+ /* * The error has been occured.*/
1725 QMMediaViewStateError
1826};
1927
@@ -23,30 +31,81 @@ typedef NS_ENUM(NSInteger, QMMediaViewState) {
2331
2432@required
2533
34+ /* *
35+ The QMMediaHandler's delegate.
36+ */
2637@property (nonatomic , weak ) id <QMMediaHandler> mediaHandler;
38+
39+ /* *
40+ The message ID.
41+ */
2742@property (nonatomic , strong ) NSString *messageID;
2843
2944@optional
3045
46+ /* *
47+ Determines whether the view should have cancel button.
48+ */
3149@property (nonatomic , assign ) BOOL cancellable;
50+
51+ /* *
52+ Determines whether the view should have play button.
53+ */
3254@property (nonatomic , assign ) BOOL playable;
3355
56+ /* *
57+ The state of the view.
58+ @see 'QMMediaViewState'.
59+ */
3460@property (nonatomic , assign ) QMMediaViewState viewState;
3561
62+ /* *
63+ Represents the current time.
64+ */
3665@property (nonatomic , assign ) NSTimeInterval currentTime;
66+ /* *
67+ Represents the current duration.
68+ */
3769@property (nonatomic , assign ) NSTimeInterval duration;
70+
71+ /* *
72+ Represents the current progress.
73+ */
3874@property (nonatomic , assign ) CGFloat progress;
3975
76+ /* *
77+ Sets the placeholder image.
78+ */
4079@property (nonatomic , strong ) UIImage *thumbnailImage;
80+
81+ /* *
82+ Sets the image.
83+ */
4184@property (nonatomic , strong ) UIImage *image;
4285
86+ /* *
87+ Tells the delegate that the error has been occured.
88+
89+ @param error The instance of NSError.
90+ */
4391- (void )showLoadingError : (NSError *)error ;
92+
93+ /* *
94+ Tells the delegate that the error has been occured.
95+
96+ @param error The instance of NSError.
97+ */
4498- (void )showUploadingError : (NSError *)error ;
4599
46100@end
47101
48102@protocol QMMediaHandler
49103
104+ /* *
105+ Tells the delegate that the media button has been tapped.
106+
107+ @param view Instance that adopts id<QMMediaViewDelegate>.
108+ */
50109- (void )didTapMediaButton : (id <QMMediaViewDelegate>)view ;
51110
52111@end
0 commit comments