Skip to content

Commit

Permalink
add tips for first play
Browse files Browse the repository at this point in the history
  • Loading branch information
typcn committed Apr 1, 2015
1 parent 639c2a4 commit a21fb76
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
12 changes: 11 additions & 1 deletion bilibili/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<textFieldCell key="cell" controlSize="mini" allowsUndo="NO" sendsActionOnEndEditing="YES" id="6Cc-jO-u6M">
<font key="font" size="12" name="STHeitiSC-Light"/>
<mutableString key="title">开发者: 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</mutableString>
<string key="title">开发者: 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</string>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
Expand Down Expand Up @@ -162,12 +162,22 @@
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="nwA-xX-SSg">
<rect key="frame" x="518" y="281" width="244" height="50"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" id="lbG-e1-MKm">
<font key="font" size="13" name="STHeitiSC-Light"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="keyPath" value="YES"/>
</userDefinedRuntimeAttributes>
<connections>
<outlet property="subtip" destination="nwA-xX-SSg" id="oAy-Dk-ud7"/>
<outlet property="textTip" destination="q3q-RS-pq9" id="aqJ-eF-Wbt"/>
</connections>
</viewController>
Expand Down
2 changes: 1 addition & 1 deletion bilibili/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<string>1.0_fix</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.video</string>
<key>LSMinimumSystemVersion</key>
Expand Down
1 change: 1 addition & 0 deletions bilibili/PlayerView.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@

@interface PlayerView : NSViewController
@property (weak) IBOutlet NSTextField *textTip;
@property (weak) IBOutlet NSTextField *subtip;

@end
16 changes: 11 additions & 5 deletions bilibili/PlayerView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion genkey.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
rm -rf bilibili/APIKey.h;
echo "NSString *APIKey = @\"\";" >> bilibili/APIKey.h;
echo "NSString *APIKey = @\"\";" >> bilibili/APIKey.h;
echo "NSString *APISecret = @\"\";" >> bilibili/APIKey.h;

0 comments on commit a21fb76

Please sign in to comment.