Skip to content

Commit

Permalink
Merge branch 'release/7.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pyby committed Aug 3, 2023
2 parents 0e59937 + b682173 commit 63a8b41
Show file tree
Hide file tree
Showing 16 changed files with 110 additions and 55 deletions.
2 changes: 2 additions & 0 deletions .bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
BUNDLE_PATH: "vendor/bundle"
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ xcuserdata
/fastlane/*.xml

/vendor
/.bundle

.vscode
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.1.3
3 changes: 3 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/SRGMediaPlayer.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
<Test
Identifier = "PlaybackTestCase/testFixedStreamEndWithBuggyAkamaiMLS3StreamWithSubtitles">
</Test>
<Test
Identifier = "PlaybackTestCase/testNonStreamedMediaPlayback">
</Test>
<Test
Identifier = "PlaybackTestCase/testOnDemandPlaybackStartAtTimeWithTolerances">
</Test>
Expand Down
1 change: 1 addition & 0 deletions .xcode-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14.3.1
2 changes: 1 addition & 1 deletion Demo/Demo.xcconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Version information
MARKETING_VERSION = 7.1.0
MARKETING_VERSION = 7.2.0

// Deployment targets
IPHONEOS_DEPLOYMENT_TARGET = 12.0
Expand Down
5 changes: 2 additions & 3 deletions Demo/SRGMediaPlayer-demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@
TargetAttributes = {
E69A1E661D61BEFC0064E6C1 = {
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = VMGRRW6SG7;
ProvisioningStyle = Automatic;
};
};
Expand Down Expand Up @@ -575,7 +574,7 @@
CLANG_CXX_LIBRARY = "libc++";
CODE_SIGN_ENTITLEMENTS = "SRGMediaPlayer-demo.entitlements";
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = VMGRRW6SG7;
DEVELOPMENT_TEAM = ABW92QGFZ7;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
Expand All @@ -602,7 +601,7 @@
CODE_SIGN_ENTITLEMENTS = "SRGMediaPlayer-demo.entitlements";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = VMGRRW6SG7;
DEVELOPMENT_TEAM = ABW92QGFZ7;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@
source 'https://rubygems.org'

gem 'fastlane'
gem 'xcode-install'
76 changes: 36 additions & 40 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.5)
CFPropertyList (3.0.6)
rexml
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.2.0)
aws-partitions (1.616.0)
aws-sdk-core (3.132.0)
aws-partitions (1.709.0)
aws-sdk-core (3.170.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.58.0)
aws-sdk-core (~> 3, >= 3.127.0)
aws-sdk-kms (1.62.0)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.114.0)
aws-sdk-core (~> 3, >= 3.127.0)
aws-sdk-s3 (1.119.0)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sigv4 (1.5.1)
aws-sigv4 (1.5.2)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
claide (1.1.0)
Expand All @@ -36,8 +36,8 @@ GEM
unf (>= 0.0.5, < 1.0.0)
dotenv (2.8.1)
emoji_regex (3.2.3)
excon (0.92.4)
faraday (1.10.1)
excon (0.99.0)
faraday (1.10.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
Expand Down Expand Up @@ -66,7 +66,7 @@ GEM
faraday_middleware (1.2.0)
faraday (~> 1.0)
fastimage (2.2.6)
fastlane (2.208.0)
fastlane (2.211.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand Down Expand Up @@ -106,9 +106,9 @@ GEM
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.25.0)
google-apis-core (>= 0.7, < 2.a)
google-apis-core (0.7.0)
google-apis-androidpublisher_v3 (0.33.0)
google-apis-core (>= 0.9.1, < 2.a)
google-apis-core (0.11.0)
addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.16.2, < 2.a)
httpclient (>= 2.8.1, < 3.a)
Expand All @@ -117,27 +117,27 @@ GEM
retriable (>= 2.0, < 4.a)
rexml
webrick
google-apis-iamcredentials_v1 (0.13.0)
google-apis-core (>= 0.7, < 2.a)
google-apis-playcustomapp_v1 (0.10.0)
google-apis-core (>= 0.7, < 2.a)
google-apis-storage_v1 (0.17.0)
google-apis-core (>= 0.7, < 2.a)
google-apis-iamcredentials_v1 (0.16.0)
google-apis-core (>= 0.9.1, < 2.a)
google-apis-playcustomapp_v1 (0.12.0)
google-apis-core (>= 0.9.1, < 2.a)
google-apis-storage_v1 (0.19.0)
google-apis-core (>= 0.9.0, < 2.a)
google-cloud-core (1.6.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-env (1.6.0)
faraday (>= 0.17.3, < 3.0)
google-cloud-errors (1.2.0)
google-cloud-storage (1.38.0)
google-cloud-errors (1.3.0)
google-cloud-storage (1.44.0)
addressable (~> 2.8)
digest-crc (~> 0.4)
google-apis-iamcredentials_v1 (~> 0.1)
google-apis-storage_v1 (~> 0.17.0)
google-apis-storage_v1 (~> 0.19.0)
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
googleauth (1.2.0)
googleauth (1.3.0)
faraday (>= 0.17.3, < 3.a)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
Expand All @@ -148,11 +148,11 @@ GEM
http-cookie (1.0.5)
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.6.1)
json (2.6.2)
jwt (2.4.1)
jmespath (1.6.2)
json (2.6.3)
jwt (2.7.0)
memoist (0.16.2)
mini_magick (4.11.0)
mini_magick (4.12.0)
mini_mime (1.1.2)
multi_json (1.15.0)
multipart-post (2.0.0)
Expand All @@ -161,7 +161,7 @@ GEM
optparse (0.1.1)
os (1.1.4)
plist (3.6.0)
public_suffix (4.0.7)
public_suffix (5.0.1)
rake (13.0.6)
representable (3.2.0)
declarative (< 0.1.0)
Expand All @@ -178,7 +178,7 @@ GEM
faraday (>= 0.17.5, < 3.a)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simctl (1.6.8)
simctl (1.6.10)
CFPropertyList
naturally
terminal-notifier (2.0.0)
Expand All @@ -194,11 +194,8 @@ GEM
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (1.8.0)
webrick (1.7.0)
webrick (1.8.1)
word_wrap (1.0.0)
xcode-install (2.8.1)
claide (>= 0.9.1)
fastlane (>= 2.1.0, < 3.0.0)
xcodeproj (1.22.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
Expand All @@ -216,7 +213,6 @@ PLATFORMS

DEPENDENCIES
fastlane
xcode-install

BUNDLED WITH
1.17.2
2.4.6
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@ test-tvos:
@xcodebuild test -scheme SRGMediaPlayer -destination 'platform=tvOS Simulator,name=Apple TV' 2> /dev/null
@echo "... done.\n"

.PHONY: rbenv
rbenv:
@echo "Installing needed ruby version if missing..."
@Scripts/rbenv-install.sh "./"
@echo "... done.\n"

.PHONY: help
help:
@echo "The following targets are available:"
@echo " all Build and run unit tests for all platforms"
@echo " test-ios Build and run unit tests for iOS"
@echo " test-tvos Build and run unit tests for tvOS"
@echo " rbenv Install needed ruby version if missing"
@echo " help Display this help message"
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import PackageDescription

struct ProjectSettings {
static let marketingVersion: String = "7.1.0"
static let marketingVersion: String = "7.2.0"
}

let package = Package(
Expand Down
25 changes: 25 additions & 0 deletions Scripts/rbenv-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# This script attempts to install the local ruby version if not installed.

REPOSITORY_FOLDER=$1

if [[ -z "${REPOSITORY_FOLDER}" ]]; then
echo "A repository folder must be provided."
exit 1
fi

RUBY_VERSION=$(cat "${REPOSITORY_FOLDER}/.ruby-version")

if [[ -z "${RUBY_VERSION}" ]]; then
echo "A local ruby version must be provided in .ruby-version file. See rbenv local command."
exit 1
fi

if ! rbenv versions | grep "${RUBY_VERSION}" &> /dev/null; then
echo "Need to install Ruby ${RUBY_VERSION}."
rbenv install "${RUBY_VERSION}"
echo "Ruby ${RUBY_VERSION} now installed."
else
echo "Ruby ${RUBY_VERSION} already installed."
fi
13 changes: 9 additions & 4 deletions Sources/SRGMediaPlayer/SRGTimeSlider~ios.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#import "CMTimeRange+SRGMediaPlayer.h"
#import "MAKVONotificationCenter+SRGMediaPlayer.h"
#import "NSBundle+SRGMediaPlayer.h"
#import "NSDate+SRGMediaPlayer.h"
#import "SRGMediaPlayerController+Private.h"
#import "UIBezierPath+SRGMediaPlayer.h"

Expand All @@ -22,8 +23,6 @@

static NSString *SRGTimeSliderFormatter(NSTimeInterval seconds)
{
NSCAssert(seconds >= 0, @"A non-negative number of seconds is expected");

if (seconds < 60. * 60.) {
static NSDateComponentsFormatter *s_dateComponentsFormatter;
static dispatch_once_t s_onceToken;
Expand Down Expand Up @@ -353,8 +352,14 @@ - (void)updateTimeRangeLabelsWithTime:(CMTime)time
}
else {
NSTimeInterval interval = self.maximumValue - self.value;
self.timeLeftValueLabel.text = [NSString stringWithFormat:@"-%@", SRGTimeSliderFormatter(interval)];
self.timeLeftValueLabel.accessibilityLabel = [NSString stringWithFormat:SRGMediaPlayerAccessibilityLocalizedString(@"%@ remaining", @"Label on slider for time remaining"), SRGTimeSliderAccessibilityFormatter(interval)];
if (SRG_NSTIMEINTERVAL_IS_VALID(interval) && interval >= 0) {
self.timeLeftValueLabel.text = SRGTimeSliderFormatter(interval);
self.timeLeftValueLabel.accessibilityLabel = [NSString stringWithFormat:SRGMediaPlayerAccessibilityLocalizedString(@"%@ remaining", @"Label on slider for time remaining"), SRGTimeSliderAccessibilityFormatter(interval)];
}
else {
self.timeLeftValueLabel.text = SRGMediaPlayerNonLocalizedString(@"--:--");
self.timeLeftValueLabel.accessibilityLabel = nil;
}
}
}
else {
Expand Down
16 changes: 16 additions & 0 deletions Sources/SRGMediaPlayer/include/NSDate+SRGMediaPlayer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// Copyright (c) SRG SSR. All rights reserved.
//
// License information is available from the LICENSE file.
//

@import Foundation;

NS_ASSUME_NONNULL_BEGIN

/**
* `NSDateComponentsFormatter` cannot use NaN or infinity time interval. Use this macro to check.
*/
#define SRG_NSTIMEINTERVAL_IS_VALID(timeInterval) (!isnan(timeInterval) && !isinf(timeInterval))

NS_ASSUME_NONNULL_END
1 change: 1 addition & 0 deletions Tests/SRGMediaPlayerTests/PlaybackTestCase.m
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,7 @@ - (void)testStreamedMediaPlayback

- (void)testNonStreamedMediaPlayback
{
#warning "This test fails in the iOS and tvOS simulator since Mac OS 13.4, see issue #124"
[self expectationForSingleNotification:SRGMediaPlayerPlaybackStateDidChangeNotification object:self.mediaPlayerController handler:^BOOL(NSNotification * _Nonnull notification) {
XCTAssertEqual([notification.userInfo[SRGMediaPlayerPlaybackStateKey] integerValue], SRGMediaPlayerPlaybackStatePreparing);
XCTAssertFalse([notification.userInfo[SRGMediaPlayerSelectedKey] boolValue]);
Expand Down
9 changes: 5 additions & 4 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,26 @@
# All lines starting with a # are ignored when running `fastlane`

# This is the minimum version number required.
fastlane_version '2.201.0'
fastlane_version '2.210.1'

default_platform :ios

platform :ios do
before_all do
ensure_git_status_clean

xcversion(version: '~> 14')
# Use .xcode-version file
xcodes(select_for_current_build_only: true)
end

desc 'Run library tests'
lane :tests do
clean_result_files
clean_derived_data

iphone13 = Device.new('iOS', 'iPhone 13')
iphone14 = Device.new('iOS', 'iPhone 14')
appletv = Device.new('tvOS', 'Apple TV')
devices = [iphone13, appletv]
devices = [iphone14, appletv]

scheme = swift_package_name
swift_package_tests = TestBuild.new(scheme, '', false)
Expand Down

0 comments on commit 63a8b41

Please sign in to comment.