提交 6e389524 编写于 作者: S Shingwa Six 提交者: Zhang Rui

ios/player: resolve issue: the property `shouldShowHudView` of...

ios/player: resolve issue: the property  `shouldShowHudView` of IJKFFMoviePlayerController was not work well
Signed-off-by: NZhang Rui <bbcallen@gmail.com>
上级 bc84b3e8
......@@ -129,10 +129,18 @@
[self.mediaControl hide];
}
- (IBAction)onClickBack:(id)sender
- (IBAction)onClickDone:(id)sender
{
if (self.presentingViewController) {
[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
}
- (IBAction)onClickHUD:(UIBarButtonItem *)sender
{
if ([self.player isKindOfClass:[IJKFFMoviePlayerController class]]) {
IJKFFMoviePlayerController *player = self.player;
player.shouldShowHudView = !player.shouldShowHudView;
sender.title = (player.shouldShowHudView ? @"HUD On" : @"HUD Off");
}
}
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="IJKVideoViewController">
......@@ -28,33 +28,6 @@
<rect key="frame" x="0.0" y="0.0" width="480" height="320"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" id="29" userLabel="Panel: Top">
<rect key="frame" x="0.0" y="0.0" width="480" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="489" image="player_top_control_bg.png" id="7" userLabel="View: Background">
<rect key="frame" x="0.0" y="0.0" width="480" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="19" userLabel="Button: Back">
<rect key="frame" x="0.0" y="2" width="60" height="42"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" image="btn_player_back_highlighted.png">
<color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="onClickBack:" destination="-1" eventType="touchUpInside" id="27"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<view contentMode="scaleToFill" id="38" userLabel="Panel: Bottom">
<rect key="frame" x="40" y="200" width="400" height="100"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
......@@ -121,6 +94,23 @@
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="4ZI-0o-F2w">
<rect key="frame" x="0.0" y="0.0" width="480" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<items>
<barButtonItem systemItem="done" id="1XF-Pk-v6Z">
<connections>
<action selector="onClickDone:" destination="-1" id="Lbg-xk-WzB"/>
</connections>
</barButtonItem>
<barButtonItem systemItem="flexibleSpace" id="pST-nN-ULY"/>
<barButtonItem title="HUD Off" id="hpK-Ob-7Cx">
<connections>
<action selector="onClickHUD:" destination="-1" id="xtO-DF-OuD"/>
</connections>
</barButtonItem>
</items>
</toolbar>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<connections>
......@@ -140,21 +130,16 @@
<outlet property="overlayPanel" destination="54" id="106"/>
<outlet property="pauseButton" destination="41" id="65"/>
<outlet property="playButton" destination="40" id="66"/>
<outlet property="topPanel" destination="29" id="37"/>
<outlet property="topPanel" destination="4ZI-0o-F2w" id="igp-Gq-Qk0"/>
<outlet property="totalDurationLabel" destination="44" id="63"/>
</connections>
<point key="canvasLocation" x="386" y="448"/>
</view>
<navigationItem title="Title" id="wNK-Og-f4q"/>
</objects>
<resources>
<image name="btn_player_back_highlighted.png" width="45" height="32"/>
<image name="btn_player_pause.png" width="36" height="37"/>
<image name="btn_player_play.png" width="36" height="36"/>
<image name="player_bottom_control_bg.png" width="400" height="100"/>
<image name="player_top_control_bg.png" width="1" height="44"/>
</resources>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>
......@@ -179,7 +179,6 @@ void IJKFFIOStatCompleteRegister(void (*cb)(const char *url,
// init fields
_scalingMode = IJKMPMovieScalingModeAspectFit;
_shouldAutoplay = YES;
_shouldShowHudView = options.showHudView;
// init media resource
_urlString = aUrlString;
......@@ -196,11 +195,14 @@ void IJKFFIOStatCompleteRegister(void (*cb)(const char *url,
// init video sink
_glView = [[IJKSDLGLView alloc] initWithFrame:[[UIScreen mainScreen] bounds]
useRenderQueue:options.useRenderQueue];
_glView.shouldShowHudView = NO;
_view = _glView;
[_glView setHudValue:nil forKey:@"scheme"];
[_glView setHudValue:nil forKey:@"host"];
[_glView setHudValue:nil forKey:@"path"];
[_glView setHudValue:nil forKey:@"ip"];
self.shouldShowHudView = options.showHudView;
ijkmp_ios_set_glview(_mediaPlayer, _glView);
ijkmp_set_option(_mediaPlayer, IJKMP_OPT_CATEGORY_PLAYER, "overlay-format", "fcc-i420");
......@@ -717,6 +719,9 @@ inline static int getPlayerOption(IJKFFOptionCategory category)
- (void)setShouldShowHudView:(BOOL)shouldShowHudView
{
if (shouldShowHudView == _shouldShowHudView) {
return;
}
_shouldShowHudView = shouldShowHudView;
if (shouldShowHudView)
[self startHudTimer];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册