Skip to content

Commit

Permalink
・曲セレクト画面で動画を少しだけ再生して曲を確認できるようにした。(hls形式)
Browse files Browse the repository at this point in the history
・↑動画プレビュのためLevel初期データのnotesを空ではなく16文字拾うようにした。
・ゲーム中メニューから曲データをリロード出来るようにした。
・動画IDがsoで始まる動画を再生できなくなっていた問題を解決。(priority決め打ちが間違いだった)
・1分以上アプリが閉じていたら動画キャッシュをクリアするようにした(HeartBeat対策)
・NicoFlickサーバ側からメッセージを伝えたいときスタートページで表示できるようにした。
・Settingsのキャッシュ数設定最大値を20→10に変更。(avplayerを34個以上保持すると再生できなくなった。プレビュで20使いたい)
・Ver.1.5更新時に見せた「お気に入り仕様変更について」をもう表示するのやめとく。
・ゲームプレイ開始時最初のノーツが3秒以内にくるとき再生開始を遅延するようにした。
・ランキングやコメントで自分の名前が空欄だった場合NO_NAME表示するようにした。
・今までUrlSessionでキャッシュが効いてしまい同じURLへのアクセスだとサーバ側の返答が異なるべきところでも前回の内容が返ってきてしまっていたのでキャッシュが効かないようにした。
・ゲームエディタのテストプレイでどの文字でもOKになるキーを設定した。
・ニコニコのページにアクセスしたときログインしてなかったらログアウト処理を省くようにした。
・動画キャッシュ削除時ちゃんとplayerをnilするようにした。(avplayer制限数に引っかかる)
・その他、細かい変更と修正を行った。
  • Loading branch information
MIZUSHIKI committed Apr 22, 2021
1 parent ef1fbd0 commit 834f232
Show file tree
Hide file tree
Showing 21 changed files with 723 additions and 111 deletions.
8 changes: 4 additions & 4 deletions NicoFlick.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -891,12 +891,12 @@
baseConfigurationReference = C201050390E3FF9EFDB81101 /* Pods-NicoFlick.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 1.7.0.1;
CURRENT_PROJECT_VERSION = 1.8.3.0;
DEVELOPMENT_TEAM = TD2CNVUXD8;
INFOPLIST_FILE = NicoFlick/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.7.0;
MARKETING_VERSION = 1.8.3;
PRODUCT_BUNDLE_IDENTIFIER = i.MIZUSHIKI.NicoFlick;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "NicoFlick/Sources/Classes/NicoFlick-Bridging-Header.h";
Expand All @@ -911,12 +911,12 @@
baseConfigurationReference = DD9B574FCC333592F9762ED9 /* Pods-NicoFlick.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 1.7.0.1;
CURRENT_PROJECT_VERSION = 1.8.3.0;
DEVELOPMENT_TEAM = TD2CNVUXD8;
INFOPLIST_FILE = NicoFlick/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.7.0;
MARKETING_VERSION = 1.8.3;
PRODUCT_BUNDLE_IDENTIFIER = i.MIZUSHIKI.NicoFlick;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "NicoFlick/Sources/Classes/NicoFlick-Bridging-Header.h";
Expand Down
60 changes: 55 additions & 5 deletions NicoFlick/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<action selector="infoButton:" destination="BYZ-38-t0r" eventType="touchUpInside" id="fde-Qx-i1Q"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Ver. 1.7.c0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EP3-v6-rBy">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Ver. 1.8.c3" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EP3-v6-rBy">
<rect key="frame" x="16" y="763" width="173" height="15"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
Expand Down Expand Up @@ -165,7 +165,7 @@
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<slider opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="1" maxValue="20" translatesAutoresizingMaskIntoConstraints="NO" id="MOM-jU-gmO">
<slider opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="1" maxValue="10" translatesAutoresizingMaskIntoConstraints="NO" id="MOM-jU-gmO">
<rect key="frame" x="112" y="383" width="233" height="30"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<connections>
Expand Down Expand Up @@ -625,6 +625,30 @@ Comment</string>
<outletCollection property="gestureRecognizers" destination="Mb0-dH-75l" appends="YES" id="lEb-KL-lL1"/>
</connections>
</label>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="DeU-sv-nCm">
<rect key="frame" x="15" y="205" width="40" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Cgj-gg-RU9">
<rect key="frame" x="0.0" y="0.0" width="40" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" heightSizable="YES"/>
<connections>
<action selector="ThumbMoviePlayButton:" destination="4hi-wq-iUU" eventType="touchUpInside" id="GHi-o0-5ZA"/>
</connections>
</button>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="play.rectangle" catalog="system" translatesAutoresizingMaskIntoConstraints="NO" id="RRz-2r-MIv">
<rect key="frame" x="0.0" y="5" width="40" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES"/>
<color key="tintColor" systemColor="systemGray4Color"/>
</imageView>
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="play.rectangle.fill" catalog="system" translatesAutoresizingMaskIntoConstraints="NO" id="ka3-xR-dxm">
<rect key="frame" x="0.0" y="5" width="40" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES"/>
<color key="tintColor" red="1" green="0.1772575676" blue="0.44396889210000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</imageView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hMf-cq-p47">
<rect key="frame" x="303" y="672" width="64" height="64"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
Expand Down Expand Up @@ -701,6 +725,8 @@ Page</string>
<outlet property="musicTags" destination="OEk-bv-gm8" id="t6W-8W-e0h"/>
<outlet property="musicTitle" destination="eDF-nf-ztv" id="m2F-in-0fF"/>
<outlet property="rankingTimeLabel" destination="Cls-4u-sW3" id="wzQ-yN-Fd1"/>
<outlet property="thumbMoviePlay" destination="RRz-2r-MIv" id="rZy-rO-G5Q"/>
<outlet property="thumbMoviePlay_Color" destination="ka3-xR-dxm" id="1Nf-Ua-cb0"/>
<segue destination="GTD-8h-Bg0" kind="presentation" identifier="toHowToExtendView" id="sGS-ew-NC5"/>
<segue destination="5MU-t5-TCd" kind="presentation" identifier="toTableViewForTagFromSelector" modalPresentationStyle="fullScreen" id="7Vo-KG-UwD"/>
<segue destination="f96-gd-zYo" kind="presentation" identifier="toTableViewForSortFromSelector" modalPresentationStyle="fullScreen" id="yqx-KD-jfF"/>
Expand Down Expand Up @@ -1426,7 +1452,7 @@ Comment</string>
<color key="textColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="HiScore更新!!" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="3OY-c6-JBc">
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="HighScore更新!!" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="3OY-c6-JBc">
<rect key="frame" x="33" y="615" width="298" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="HiraMaruProN-W4" family="Hiragino Maru Gothic ProN" pointSize="18"/>
Expand Down Expand Up @@ -1588,6 +1614,18 @@ Comment</string>
<action selector="resume:" destination="ZIg-Y5-IFt" eventType="touchUpInside" id="z1t-hJ-ikE"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Zce-Bs-1cc">
<rect key="frame" x="270" y="605" width="75" height="46"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" name="HiraginoSans-W6" family="Hiragino Sans" pointSize="12"/>
<state key="normal" title="曲リロード">
<color key="titleColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="musicReload:" destination="ZIg-Y5-IFt" eventType="touchUpInside" id="ikT-yA-dbw"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="S8V-0s-0zb">
<rect key="frame" x="123" y="605" width="130" height="46"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
Expand Down Expand Up @@ -3285,6 +3323,13 @@ CgoKCgoKCgoKCgoKCgoKA
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="^_^ 、。?! 改行 でタイミングだけの確認ができます" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bhs-HO-ru8">
<rect key="frame" x="0.0" y="210" width="375" height="22"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="10"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
Expand Down Expand Up @@ -3749,7 +3794,7 @@ CgoKCgoKCgoKCgoKCgoKA
<connections>
<outlet property="mainView" destination="qcm-qI-e9f" id="112-r6-osQ"/>
<outlet property="tabBar" destination="eYe-Zr-eQo" id="vQc-fs-bAm"/>
<segue destination="jGJ-r5-YRo" kind="unwind" unwindAction="returnToMeWithSegue:" id="JJU-DG-zsU"/>
<segue destination="jGJ-r5-YRo" kind="unwind" identifier="fromWikipageWebkit" unwindAction="returnToMeWithSegue:" id="JJU-DG-zsU"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="HUQ-Ee-us0" userLabel="First Responder" sceneMemberID="firstResponder"/>
Expand Down Expand Up @@ -3939,7 +3984,7 @@ CgoKCgoKCgoKCgoKCgoKA
<segue reference="yqx-KD-jfF"/>
<segue reference="7Vo-KG-UwD"/>
<segue reference="LyO-M0-Zea"/>
<segue reference="Ph5-xf-06b"/>
<segue reference="B0R-EA-o7j"/>
</inferredMetricsTieBreakers>
<resources>
<image name="Twitter_Social_Icon_Rounded_Square_Color_x100.png" width="100" height="100"/>
Expand Down Expand Up @@ -3968,6 +4013,8 @@ CgoKCgoKCgoKCgoKCgoKA
<image name="menu.png" width="64" height="64"/>
<image name="newfavo-black.png" width="430" height="766"/>
<image name="newfavo-color.png" width="430" height="766"/>
<image name="play.rectangle" catalog="system" width="128" height="93"/>
<image name="play.rectangle.fill" catalog="system" width="128" height="93"/>
<image name="ranking.png" width="32" height="32"/>
<image name="star-bk.png" width="256" height="256"/>
<image name="star-color.png" width="256" height="256"/>
Expand All @@ -3987,6 +4034,9 @@ CgoKCgoKCgoKCgoKCgoKA
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemGray4Color">
<color red="0.81960784313725488" green="0.81960784313725488" blue="0.83921568627450982" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemOrangeColor">
<color red="1" green="0.58431372549019611" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
Expand Down
16 changes: 13 additions & 3 deletions NicoFlick/Sources/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?

static let PHPURL = "http://timetag.main.jp/nicoflick/nicoflick.php"
//static let PHPURL = "http://192.168.11.8/nicoflick_20201103/nicoflick.php" //windows xampp
//static let PHPURL = "http://192.168.11.7/nicoflick_20201103/nicoflick.php" //windows xampp
//static let PHPURL = "http://127.0.0.1:8888/nicoflick.php" //mac mamp PC
//static let PHPURL = "http://MacBook.local:8000/nicoflick.php" //mac mamp スマホ
static let NicoApiURL_GetThumbInfo = "http://ext.nicovideo.jp/api/getthumbinfo/"
static let Version = 1701
static var Flg_NicoLogout = false
static let Version = 1830
static var ServerErrorMessage = ""
static var DidEnterBackgroundTime:Date?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
Expand All @@ -46,10 +47,19 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
AppDelegate.DidEnterBackgroundTime = Date()
}

func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
if let backDate = AppDelegate.DidEnterBackgroundTime {
if backDate.timeIntervalSinceNow < -60.0 {
//アプリ閉じて60秒以上立ってたら動画のキャッシュを削除する
print("Cached(Thumb)Movies削除")
CachedMovies.sharedInstance.cachedMovies = [] //HeartBeat切れるとアクセス出来なくなる
CachedThumbMovies.sharedInstance.cachedMovies = [] //HeartBeatすらしてない
}
}
}

func applicationDidBecomeActive(_ application: UIApplication) {
Expand Down
Loading

0 comments on commit 834f232

Please sign in to comment.