From a21fb7603e1e122d8173a27791528884c6fb68b1 Mon Sep 17 00:00:00 2001 From: TYPCN Date: Wed, 1 Apr 2015 22:25:30 +0800 Subject: [PATCH] add tips for first play --- bilibili/Base.lproj/Main.storyboard | 12 +++++++++++- bilibili/Info.plist | 2 +- bilibili/PlayerView.h | 1 + bilibili/PlayerView.mm | 16 +++++++++++----- genkey.sh | 2 +- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/bilibili/Base.lproj/Main.storyboard b/bilibili/Base.lproj/Main.storyboard index c22be8a..f0cbd41 100644 --- a/bilibili/Base.lproj/Main.storyboard +++ b/bilibili/Base.lproj/Main.storyboard @@ -92,7 +92,7 @@ - 开发者: typcn
博客: http://blog.eqoe.cn
源代码: https://github.com/typcn/bilibili-mac-client
许可协议: GPLv2

感谢:
Bilidan - https://github.com/m13253/BiliDan

使用以下开源项目:
MPV - https://github.com/mpv-player/mpv
ISSoundAdditions - https://github.com/InerziaSoft/ISSoundAdditions
Sparkle - https://github.com/sparkle-project/Sparkle
Danmaku2ASS - https://github.com/m13253/danmaku2ass
FFmpeg - https://www.ffmpeg.org/

Copyleft 2015 TYPCN + 开发者: typcn
博客: http://blog.eqoe.cn
源代码: https://github.com/typcn/bilibili-mac-client
许可协议: GPLv2

感谢:
Bilidan - https://github.com/m13253/BiliDan

使用以下开源项目:
MPV - https://github.com/mpv-player/mpv
ISSoundAdditions - https://github.com/InerziaSoft/ISSoundAdditions
Sparkle - https://github.com/sparkle-project/Sparkle
Danmaku2ASS - https://github.com/m13253/danmaku2ass
FFmpeg - https://www.ffmpeg.org/

Copyleft 2015 TYPCN @@ -162,12 +162,22 @@ + + + + + + + + + + diff --git a/bilibili/Info.plist b/bilibili/Info.plist index a072a4e..a69899b 100644 --- a/bilibili/Info.plist +++ b/bilibili/Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 1.0 + 1.0_fix LSApplicationCategoryType public.app-category.video LSMinimumSystemVersion diff --git a/bilibili/PlayerView.h b/bilibili/PlayerView.h index ae4ff4f..2d3b0ed 100644 --- a/bilibili/PlayerView.h +++ b/bilibili/PlayerView.h @@ -10,5 +10,6 @@ @interface PlayerView : NSViewController @property (weak) IBOutlet NSTextField *textTip; +@property (weak) IBOutlet NSTextField *subtip; @end diff --git a/bilibili/PlayerView.mm b/bilibili/PlayerView.mm index 9d3b40d..cb26255 100644 --- a/bilibili/PlayerView.mm +++ b/bilibili/PlayerView.mm @@ -321,11 +321,17 @@ - (void) handleEvent:(mpv_event *)event } case MPV_EVENT_PLAYBACK_RESTART: { - double delayInSeconds = 20.0; - dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); - dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ - [self.textTip setStringValue:@"播放完成"]; - }); + if([[[NSUserDefaults standardUserDefaults] objectForKey:@"FirstPlayed"] length] < 1){ + [[NSUserDefaults standardUserDefaults] setObject:@"yes" forKey:@"FirstPlayed"]; + [self.textTip setStringValue:@"正在创建字体缓存"]; + [self.subtip setStringValue:@"首次播放需要最多 2 分钟来建立缓存\n请不要关闭窗口"]; + }else{ + double delayInSeconds = 20.0; + dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); + dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ + [self.textTip setStringValue:@"播放完成"]; + }); + } } default: diff --git a/genkey.sh b/genkey.sh index 954dd30..71a6eed 100644 --- a/genkey.sh +++ b/genkey.sh @@ -1,3 +1,3 @@ rm -rf bilibili/APIKey.h; echo "NSString *APIKey = @\"\";" >> bilibili/APIKey.h; -echo "NSString *APIKey = @\"\";" >> bilibili/APIKey.h; \ No newline at end of file +echo "NSString *APISecret = @\"\";" >> bilibili/APIKey.h; \ No newline at end of file