Compare commits

28 Commits

Author SHA1 Message Date
Freddy Kellison-Linn 7f7f2157fd Release 1.3.0 2018-07-18 15:42:21 -04:00
Freddy Kellison-Linn 2a11f34165 Add explanatory comment for SDH 2018-07-18 15:42:21 -04:00
Freddy Kellison-Linn 0a28c0cc1b Use new matches(_:) method in select(_:) 2018-07-18 15:42:21 -04:00
Freddy Kellison-Linn a31eafca1f Fixup style 2018-07-18 15:42:21 -04:00
Freddy Kellison-Linn 6e8446675e Change == operator to matches(_:) method 2018-07-18 15:42:21 -04:00
Freddy Kellison-Linn dd3f9937b2 Make TextTrackMetadata == global 2018-07-18 15:42:21 -04:00
Freddy Kellison-Linn fb7879346a Improve TextTrackMetadata and TextTrackCapable APIs 2018-07-18 15:42:21 -04:00
Freddy Kellison-Linn 393e659cf0 Remove deprecated API in newer versions 2018-07-18 15:42:21 -04:00
Freddy Kellison-Linn 17c04841dd Add selectedTrack requirement to TextTrackCapable 2018-07-18 15:42:21 -04:00
Freddy Kellison-Linn 19328921bb Use Array.first instead of for-in loop 2018-07-18 15:42:21 -04:00
Freddy Kellison-Linn 14f1e26dfd Move TextTrackCapable conformance to extension 2018-07-18 15:42:21 -04:00
Freddy Kellison-Linn a031f37000 Make RegularPlayer conform to TextTrackCapable and AVMediaSelectionOption to TextTrackMetadata 2018-07-18 15:42:20 -04:00
Freddy Kellison-Linn ceeb22419f Add period 2018-07-18 15:42:20 -04:00
Freddy Kellison-Linn c02d5aba36 Add TextTrackMetadata and TextTrackCapable protocols to Player.swift 2018-07-18 15:42:20 -04:00
Mike Westendorf 9490ecc197 updates cocoapods to version 1.5.2, updates git ignore file 2018-07-18 15:42:20 -04:00
Gavin King d9fd6ec9e0 Merge pull request #24 from vimeo/develop
Merging master into develop
2017-12-07 16:27:04 -05:00
Gavin King 1d5a54e427 Merge pull request #23 from vimeo/VIM-XXX-swift-version
Update .swift-version
2017-12-07 16:24:31 -05:00
Gavin King 9e72e81f44 Update .swift-version 2017-12-07 16:19:10 -05:00
Gavin King bd27ed90de Merge pull request #22 from vimeo/develop
Merging develop into master
2017-12-07 16:02:01 -05:00
Gavin King 0be337a29f Merge pull request #21 from vimeo/AF-210-swift-4
AF-210: Swift 4
2017-12-07 16:00:55 -05:00
Gavin King 15933a66a3 fastlane 2017-11-29 17:12:08 -05:00
Gavin King 57533faa36 example version increment 2017-11-29 17:09:41 -05:00
Gavin King 5067393d78 inference 2017-11-29 17:08:35 -05:00
Gavin King 0245cf6f8b version increment 2017-11-29 16:55:38 -05:00
Gavin King c0e553dcbf @objc 2017-11-29 16:54:40 -05:00
Gavin King c15d31d6af migration and FillModeCapable changes 2017-11-29 16:18:45 -05:00
Gavin King 3981702cfe minimum requirements 2017-10-09 11:14:18 -04:00
Gavin King c057324b82 Update README.md 2017-10-06 17:04:18 -04:00
13 changed files with 243 additions and 138 deletions
+1
View File
@@ -21,6 +21,7 @@ xcuserdata/
*.moved-aside
*.xccheckout
*.xcscmblueprint
.DS_Store
## Obj-C/Swift specific
*.hmap
+1 -1
View File
@@ -1 +1 @@
3.2
4.0
+21 -56
View File
@@ -174,7 +174,6 @@
607FACCD1AFB9204008FA782 /* Frameworks */,
607FACCE1AFB9204008FA782 /* Resources */,
AEEB7FDEAB18BB5B2C3B7E51 /* [CP] Embed Pods Frameworks */,
321F705B84CEA2E392A6B199 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -193,8 +192,6 @@
607FACE11AFB9204008FA782 /* Sources */,
607FACE21AFB9204008FA782 /* Frameworks */,
607FACE31AFB9204008FA782 /* Resources */,
25C5F87D98E09CBD3E2CA814 /* [CP] Embed Pods Frameworks */,
3C28040621F8BDAC7AF4AA8F /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -219,12 +216,12 @@
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = 35R365FS4Q;
LastSwiftMigration = 0820;
LastSwiftMigration = 0900;
};
607FACE41AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = 35R365FS4Q;
LastSwiftMigration = 0820;
LastSwiftMigration = 0900;
TestTargetID = 607FACCF1AFB9204008FA782;
};
};
@@ -270,64 +267,22 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
25C5F87D98E09CBD3E2CA814 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PlayerKit_Tests/Pods-PlayerKit_Tests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
321F705B84CEA2E392A6B199 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PlayerKit_Example/Pods-PlayerKit_Example-resources.sh\"\n";
showEnvVarsInLog = 0;
};
39DBB93200760D1BB486C4CC /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-PlayerKit_Example-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
3C28040621F8BDAC7AF4AA8F /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PlayerKit_Tests/Pods-PlayerKit_Tests-resources.sh\"\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
AEEB7FDEAB18BB5B2C3B7E51 /* [CP] Embed Pods Frameworks */ = {
@@ -336,9 +291,12 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-PlayerKit_Example/Pods-PlayerKit_Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/PlayerKit/PlayerKit.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PlayerKit.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
@@ -351,13 +309,16 @@
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-PlayerKit_Tests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@@ -503,7 +464,8 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
@@ -520,7 +482,8 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
@@ -539,7 +502,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
@@ -553,7 +517,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Release;
};
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -40,6 +40,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -69,6 +70,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
+4 -4
View File
@@ -1,16 +1,16 @@
PODS:
- PlayerKit (1.1.0)
- PlayerKit (1.2.0)
DEPENDENCIES:
- PlayerKit (from `../`)
EXTERNAL SOURCES:
PlayerKit:
:path: ../
:path: "../"
SPEC CHECKSUMS:
PlayerKit: 3f06187a533ce4e2a8aa29583e561b465d0d085e
PlayerKit: ff4e4cd4c216d60ebcfccf3a68772d6299373e5a
PODFILE CHECKSUM: 071d8819500a822237123321021901352f4d91a4
COCOAPODS: 1.2.0
COCOAPODS: 1.5.2
+1 -1
View File
@@ -1,6 +1,6 @@
source 'https://rubygems.org'
gem 'fastlane', '2.42.0'
gem 'cocoapods', '1.2.0'
gem 'cocoapods', '1.5.2'
gem 'danger', '4.0.4'
gem 'xcode-install', '2.1.0'
gem 'xcpretty-json-formatter', '0.1.0'
+65 -61
View File
@@ -1,60 +1,62 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (2.3.5)
activesupport (4.2.9)
CFPropertyList (2.3.6)
activesupport (4.2.10)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.5.1)
public_suffix (~> 2.0, >= 2.0.2)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
atomos (0.1.2)
babosa (1.0.2)
claide (1.0.2)
claide-plugins (0.9.2)
cork
nap
open4 (~> 1.3)
cocoapods (1.2.0)
cocoapods (1.5.2)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.1, < 2.0)
cocoapods-core (= 1.2.0)
cocoapods-deintegrate (>= 1.0.1, < 2.0)
cocoapods-downloader (>= 1.1.3, < 2.0)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.5.2)
cocoapods-deintegrate (>= 1.0.2, < 2.0)
cocoapods-downloader (>= 1.2.0, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-stats (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.1.2, < 2.0)
cocoapods-trunk (>= 1.3.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored (~> 1.2)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (~> 2.0.1)
gh_inspector (~> 1.0)
molinillo (~> 0.5.5)
molinillo (~> 0.6.5)
nap (~> 1.0)
ruby-macho (~> 0.2.5)
xcodeproj (>= 1.4.1, < 2.0)
cocoapods-core (1.2.0)
activesupport (>= 4.0.2, < 5)
ruby-macho (~> 1.1)
xcodeproj (>= 1.5.7, < 2.0)
cocoapods-core (1.5.2)
activesupport (>= 4.0.2, < 6)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
cocoapods-deintegrate (1.0.1)
cocoapods-downloader (1.1.3)
cocoapods-deintegrate (1.0.2)
cocoapods-downloader (1.2.0)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.0)
cocoapods-stats (1.0.0)
cocoapods-trunk (1.2.0)
cocoapods-trunk (1.3.0)
nap (>= 0.8, < 2.0)
netrc (= 0.7.8)
netrc (~> 0.11)
cocoapods-try (1.1.0)
colored (1.2)
colored2 (3.1.2)
colorize (0.8.1)
commander-fastlane (4.4.5)
commander-fastlane (4.4.6)
highline (~> 1.7.2)
cork (0.2.0)
colored (~> 1.2)
concurrent-ruby (1.0.5)
cork (0.3.0)
colored2 (~> 3.1)
danger (4.0.4)
claide (~> 1.0)
claide-plugins (>= 0.9.2)
@@ -70,23 +72,23 @@ GEM
danger (> 2.0)
danger-xcode_summary (0.1.0)
danger-plugin-api (~> 1.0)
declarative (0.0.9)
declarative (0.0.10)
declarative-option (0.1.0)
domain_name (0.5.20170404)
domain_name (0.5.20180417)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.2.1)
dotenv (2.4.0)
escape (0.0.4)
excon (0.57.1)
faraday (0.12.1)
excon (0.62.0)
faraday (0.15.2)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
faraday (>= 0.7.4)
http-cookie (~> 1.0.0)
faraday-http-cache (1.3.1)
faraday (~> 0.8)
faraday_middleware (0.11.0.1)
faraday_middleware (0.12.2)
faraday (>= 0.7.4, < 1.0)
fastimage (2.1.0)
fastimage (2.1.3)
fastlane (2.42.0)
CFPropertyList (>= 2.3, < 3.0.0)
addressable (>= 2.3, < 3.0.0)
@@ -125,8 +127,8 @@ GEM
terminal-table
fourflusher (2.0.1)
fuzzy_match (2.0.4)
gh_inspector (1.0.3)
git (1.3.0)
gh_inspector (1.1.3)
git (1.4.0)
google-api-client (0.12.0)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 0.5)
@@ -134,22 +136,23 @@ GEM
mime-types (~> 3.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
googleauth (0.5.1)
faraday (~> 0.9)
jwt (~> 1.4)
googleauth (0.6.2)
faraday (~> 0.12)
jwt (>= 1.4, < 3.0)
logging (~> 2.0)
memoist (~> 0.12)
multi_json (~> 1.11)
os (~> 0.9)
signet (~> 0.7)
highline (1.7.8)
highline (1.7.10)
http-cookie (1.0.3)
domain_name (~> 0.5)
httpclient (2.8.3)
i18n (0.8.6)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
json (2.1.0)
jwt (1.5.6)
kramdown (1.13.2)
jwt (2.1.0)
kramdown (1.16.2)
little-plugger (1.1.4)
logging (2.2.2)
little-plugger (~> 1.1)
@@ -160,73 +163,74 @@ GEM
mime-types-data (3.2016.0521)
mini_magick (4.5.1)
mini_portile (0.5.3)
minitest (5.10.2)
molinillo (0.5.7)
multi_json (1.12.1)
minitest (5.11.3)
molinillo (0.6.5)
multi_json (1.13.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
nanaimo (0.2.3)
nanaimo (0.2.5)
nap (1.1.0)
netrc (0.7.8)
netrc (0.11.0)
nokogiri (1.6.0)
mini_portile (~> 0.5.0)
octokit (4.6.2)
octokit (4.9.0)
sawyer (~> 0.8.0, >= 0.5.3)
open4 (1.3.4)
os (0.9.6)
plist (3.3.0)
public_suffix (2.0.5)
plist (3.4.0)
public_suffix (3.0.2)
representable (3.0.4)
declarative (< 0.1.0)
declarative-option (< 0.2.0)
uber (< 0.2.0)
retriable (3.0.2)
retriable (3.1.1)
rouge (2.0.7)
ruby-macho (0.2.6)
ruby-macho (1.1.0)
rubyzip (1.2.1)
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
security (0.1.3)
signet (0.7.3)
signet (0.8.1)
addressable (~> 2.3)
faraday (~> 0.9)
jwt (~> 1.5)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
slack-notifier (1.5.1)
terminal-notifier (1.8.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
tty-screen (0.5.0)
tzinfo (1.2.3)
tty-screen (0.5.1)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uber (0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.4)
unicode-display_width (1.3.0)
unf_ext (0.0.7.5)
unicode-display_width (1.3.2)
word_wrap (1.0.0)
xcode-install (2.1.0)
claide (>= 0.9.1, < 1.1.0)
fastlane (>= 2.1.1, < 3.0.0)
xcodeproj (1.5.0)
CFPropertyList (~> 2.3.3)
xcodeproj (1.5.9)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.2)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.2.3)
nanaimo (~> 0.2.5)
xcpretty (0.2.8)
rouge (~> 2.0.7)
xcpretty-json-formatter (0.1.0)
xcpretty (~> 0.2, >= 0.0.7)
xcpretty-travis-formatter (0.0.4)
xcpretty-travis-formatter (1.0.0)
xcpretty (~> 0.2, >= 0.0.7)
PLATFORMS
ruby
DEPENDENCIES
cocoapods (= 1.2.0)
cocoapods (= 1.5.2)
danger (= 4.0.4)
danger-xcode_summary (= 0.1.0)
fastlane (= 2.42.0)
@@ -236,4 +240,4 @@ DEPENDENCIES
xcpretty-json-formatter (= 0.1.0)
BUNDLED WITH
1.15.1
1.15.3
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'PlayerKit'
s.version = '1.1.0'
s.version = '1.3.0'
s.summary = 'A modular video player system.'
s.description = <<-DESC
+39 -4
View File
@@ -37,9 +37,9 @@ public enum PlayerError: Int
/// Represents the current state of the player
///
/// - Loading: The player is loading or buffering
/// - Ready: The player is ready for playback
/// - Failed: The player has failed
/// - loading: The player is loading or buffering
/// - ready: The player is ready for playback
/// - failed: The player has failed
@objc public enum PlayerState: Int
{
case loading
@@ -110,7 +110,42 @@ public enum PlayerError: Int
/// A player that adopts the ProvidesView protocol is capable of setting the video fill mode.
@objc public protocol FillModeCapable
{
var fillMode: String { get set }
var fillMode: FillMode { get set }
}
@objc public enum FillMode: Int
{
case fit
case fill
}
/// The metadata that should be attached to any type of text track.
@objc public protocol TextTrackMetadata
{
var displayName: String { get }
var locale: Locale? { get }
// Indicates that the text track represents subtitles for the def and hard of hearing (SDH).
var isSDHTrack: Bool { get }
@objc(displayNameWithLocale:) func displayName(with locale: Locale) -> String
}
extension TextTrackMetadata
{
public func matches(_ other: TextTrackMetadata) -> Bool
{
return (self.locale == other.locale && self.isSDHTrack == other.isSDHTrack)
}
}
/// A player that conforms to the TextTrackCapable protocol is capable of advertising and displaying text tracks.
@objc public protocol TextTrackCapable
{
var selectedTextTrack: TextTrackMetadata? { get }
var availableTextTracks: [TextTrackMetadata] { get }
func fetchTextTracks(completion: @escaping ([TextTrackMetadata], TextTrackMetadata?) -> Void)
func select(_ textTrack: TextTrackMetadata?)
}
#if os(iOS)
+95 -5
View File
@@ -11,8 +11,16 @@ import Foundation
import AVFoundation
import AVKit
extension AVMediaSelectionOption: TextTrackMetadata
{
public var isSDHTrack: Bool
{
return self.hasMediaCharacteristic(.describesMusicAndSoundForAccessibility) && self.hasMediaCharacteristic(.transcribesSpokenDialogForAccessibility)
}
}
/// A RegularPlayer is used to play regular videos.
open class RegularPlayer: NSObject, Player, ProvidesView
@objc open class RegularPlayer: NSObject, Player, ProvidesView
{
public struct Constants
{
@@ -28,7 +36,7 @@ open class RegularPlayer: NSObject, Player, ProvidesView
/// Sets an AVAsset on the player.
///
/// - Parameter asset: The AVAsset
open func set(_ asset: AVAsset)
@objc open func set(_ asset: AVAsset)
{
// Prepare the old item for removal
@@ -373,15 +381,97 @@ extension RegularPlayer: VolumeCapable
extension RegularPlayer: FillModeCapable
{
public var fillMode: String
public var fillMode: FillMode
{
get
{
return (self.view.layer as! AVPlayerLayer).videoGravity
let gravity = (self.view.layer as! AVPlayerLayer).videoGravity
return gravity == .resizeAspect ? .fit : .fill
}
set
{
(self.view.layer as! AVPlayerLayer).videoGravity = newValue
let gravity: AVLayerVideoGravity
switch newValue
{
case .fit:
gravity = .resizeAspect
case .fill:
gravity = .resizeAspectFill
}
(self.view.layer as! AVPlayerLayer).videoGravity = gravity
}
}
}
extension RegularPlayer: TextTrackCapable
{
public var selectedTextTrack: TextTrackMetadata?
{
guard let group = self.player.currentItem?.asset.mediaSelectionGroup(forMediaCharacteristic: .legible) else
{
return nil
}
if #available(iOS 9.0, *)
{
return self.player.currentItem?.currentMediaSelection.selectedMediaOption(in: group)
}
else
{
return self.player.currentItem?.selectedMediaOption(in: group)
}
}
public var availableTextTracks: [TextTrackMetadata]
{
guard let group = self.player.currentItem?.asset.mediaSelectionGroup(forMediaCharacteristic: .legible) else
{
return []
}
return group.options
}
public func fetchTextTracks(completion: @escaping ([TextTrackMetadata], TextTrackMetadata?) -> Void)
{
self.player.currentItem?.asset.loadValuesAsynchronously(forKeys: [#keyPath(AVAsset.availableMediaCharacteristicsWithMediaSelectionOptions)]) { [weak self] in
guard let strongSelf = self, let group = strongSelf.player.currentItem?.asset.mediaSelectionGroup(forMediaCharacteristic: .legible) else
{
completion([], nil)
return
}
if #available(iOS 9.0, *)
{
completion(group.options, strongSelf.player.currentItem?.currentMediaSelection.selectedMediaOption(in: group))
}
else
{
completion(group.options, strongSelf.player.currentItem?.selectedMediaOption(in: group))
}
}
}
public func select(_ textTrack: TextTrackMetadata?)
{
guard let group = self.player.currentItem?.asset.mediaSelectionGroup(forMediaCharacteristic: .legible) else
{
return
}
guard let track = textTrack else
{
self.player.currentItem?.select(nil, in: group)
return
}
let option = group.options.first(where: { option in
track.matches(option)
})
self.player.currentItem?.select(option, in: group)
}
}
+3 -3
View File
@@ -1,6 +1,6 @@
# PlayerKit
[![CI Status](http://img.shields.io/travis/ghking/PlayerKit.svg?style=flat)](https://travis-ci.org/ghking/PlayerKit)
[![CI Status](http://img.shields.io/travis/ghking/PlayerKit.svg?style=flat)](https://travis-ci.org/vimeo/PlayerKit)
[![Version](https://img.shields.io/cocoapods/v/PlayerKit.svg?style=flat)](http://cocoapods.org/pods/PlayerKit)
[![License](https://img.shields.io/cocoapods/l/PlayerKit.svg?style=flat)](http://cocoapods.org/pods/PlayerKit)
[![Platform](https://img.shields.io/cocoapods/p/PlayerKit.svg?style=flat)](http://cocoapods.org/pods/PlayerKit)
@@ -20,9 +20,9 @@ Vimeo supports various types of video and playback (360 video, Chromecast, etc.)
To run the example project, clone the repo, and run `pod install` from the Example directory.
## Requirements
## Minimum Requirements
- iOS 8.0+ / tvOS 9.0+
- iOS 8.0 / tvOS 9.0
- Swift 3.2
## Installation
+1 -1
View File
@@ -17,7 +17,7 @@ default_platform :ios
platform :ios do
before_all do
ensure_xcode_version(version: "9.0")
ensure_xcode_version(version: "9.0.1")
end
desc "run tests"