Skip to content

Commit

Permalink
Merge branch 'release/2.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
defagos committed May 28, 2018
2 parents 0f25c5d + b6c1e94 commit b0e4196
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 19 deletions.
6 changes: 6 additions & 0 deletions Demo/Resources/VideoDemoConfiguration.plist
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
<key>url</key>
<string>http://stream-i.rts.ch/i/bidbi/2007/bidbi_01082007-,450,k.mp4.csmil/master.m3u8</string>
</dict>
<dict>
<key>name</key>
<string>Gens d&apos;hiver</string>
<key>url</key>
<string>https://rtsvodww-vh.akamaihd.net/i/genhi/2018/genhi_20180126_full_f_1067247-,301k,101k,701k,1201k,2001k,fra-ad,.mp4.csmil/master.m3u8?audiotrack=0:fra:Fran%25C3%25A7ais,5:fra:Fran%25C3%25A7ais+%2528AD%2529</string>
</dict>
<dict>
<key>name</key>
<string>Short non-streamed video</string>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13770" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="d9c-I7-8ft">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="d9c-I7-8ft">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13770"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down Expand Up @@ -95,13 +95,10 @@
<rect key="frame" x="6" y="567" width="363" height="94"/>
<subviews>
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="EKV-Dg-mkD" customClass="SRGTimeSlider">
<rect key="frame" x="14" y="10" width="335" height="17"/>
<rect key="frame" x="14" y="10" width="335" height="31"/>
<color key="minimumTrackTintColor" red="0.83741801979999997" green="0.83743780850000005" blue="0.83742713930000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="maximumTrackTintColor" red="0.66422420739999999" green="0.66424006219999998" blue="0.66423153879999997" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" red="0.66422420739999999" green="0.66424006219999998" blue="0.66423153879999997" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="bufferingTrackColor">
<color key="value" red="0.83741801979999997" green="0.83743780850000005" blue="0.83742713930000001" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
Expand All @@ -112,7 +109,7 @@
</connections>
</slider>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="I3E-bM-bxI" customClass="SRGAirplayButton">
<rect key="frame" x="4" y="46.5" width="40" height="40"/>
<rect key="frame" x="4" y="43" width="40" height="40"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="tintColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
Expand All @@ -121,7 +118,7 @@
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="BRy-c9-UCc" userLabel="Skip Backward Button">
<rect key="frame" x="106.5" y="46.5" width="40" height="40"/>
<rect key="frame" x="106.5" y="43" width="40" height="40"/>
<constraints>
<constraint firstAttribute="width" constant="40" id="ZuJ-hh-dcV"/>
<constraint firstAttribute="height" constant="40" id="eE0-aI-DSc"/>
Expand All @@ -133,7 +130,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gL8-ry-Lc7" userLabel="Playback Button" customClass="SRGPlaybackButton">
<rect key="frame" x="166.5" y="53" width="30" height="27"/>
<rect key="frame" x="166.5" y="46" width="30" height="34"/>
<constraints>
<constraint firstAttribute="width" constant="30" id="mFJ-mP-3tP"/>
</constraints>
Expand All @@ -144,7 +141,7 @@
</userDefinedRuntimeAttributes>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3vg-6i-6jj" userLabel="Skip Forward Button">
<rect key="frame" x="216.5" y="46.5" width="40" height="40"/>
<rect key="frame" x="216.5" y="43" width="40" height="40"/>
<constraints>
<constraint firstAttribute="width" constant="40" id="gG2-Rr-OLL"/>
<constraint firstAttribute="height" constant="40" id="zCj-XB-K3G"/>
Expand All @@ -156,22 +153,22 @@
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="99:99" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cyE-ky-Dbl">
<rect key="frame" x="16" y="32" width="32" height="13.5"/>
<rect key="frame" x="16" y="46" width="32" height="13.5"/>
<fontDescription key="fontDescription" type="system" pointSize="11"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="99:99" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Erw-ST-7Yg">
<rect key="frame" x="315" y="32" width="32" height="13.5"/>
<rect key="frame" x="315" y="46" width="32" height="13.5"/>
<fontDescription key="fontDescription" type="system" pointSize="11"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<activityIndicatorView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" style="white" translatesAutoresizingMaskIntoConstraints="NO" id="omh-tb-D23">
<rect key="frame" x="10" y="28" width="20" height="20"/>
<rect key="frame" x="10" y="42" width="20" height="20"/>
</activityIndicatorView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="xRb-AE-54i" customClass="SRGTracksButton">
<rect key="frame" x="317" y="46" width="40" height="40"/>
<rect key="frame" x="317" y="42.5" width="40" height="40"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="tintColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
Expand Down
23 changes: 20 additions & 3 deletions Framework/Sources/Overlays/SRGAlternateTracksViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
//
#import "SRGAlternateTracksViewController.h"

#import "NSBundle+SRGMediaPlayer.h"
#import "NSBundle+SRGMediaPlayer.h"

static NSString *SRGTitleForMediaOption(AVMediaSelectionOption *option);

@interface SRGAlternateTracksViewController ()

Expand Down Expand Up @@ -169,7 +171,7 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)ce
}
else {
AVMediaSelectionOption *option = (characteristic == AVMediaCharacteristicLegible) ? group.options[indexPath.row - 1] : group.options[indexPath.row];
cell.textLabel.text = option.displayName;
cell.textLabel.text = SRGTitleForMediaOption(option);

AVMediaSelectionOption *currentOptionInGroup = [self.player.currentItem selectedMediaOptionInMediaSelectionGroup:group];
cell.accessoryType = [currentOptionInGroup isEqual:option] ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
Expand Down Expand Up @@ -207,4 +209,19 @@ - (void)done:(id)sender
completion:nil];
}

@end
@end

static NSString *SRGTitleForMediaOption(AVMediaSelectionOption *option)
{
// Retrieve title metadata if available (use preferred language settings to present the best one to the user)
NSArray<AVMetadataItem *> *titleItems = [AVMetadataItem metadataItemsFromArray:option.commonMetadata withKey:AVMetadataCommonKeyTitle keySpace:AVMetadataKeySpaceCommon];
if (titleItems) {
titleItems = [AVMetadataItem metadataItemsFromArray:titleItems filteredAndSortedAccordingToPreferredLanguages:NSLocale.preferredLanguages];

NSString *title = titleItems.firstObject.stringValue;
if (title) {
return title;
}
}
return option.displayName;
}
4 changes: 2 additions & 2 deletions SRGMediaPlayer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MARKETING_VERSION = 2.4;
MARKETING_VERSION = 2.4.1;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -1255,7 +1255,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MARKETING_VERSION = 2.4;
MARKETING_VERSION = 2.4.1;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
Expand Down

0 comments on commit b0e4196

Please sign in to comment.