Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 58ff13c70b | |||
| d6c5ab0629 | |||
| ea5b11e13c | |||
| 6ac137f9ff | |||
| 5e197fd1c5 | |||
| 0d91f5a054 | |||
| 09f58850e8 | |||
| 088d368709 | |||
| 4508acf2ed | |||
| 7ae3643508 | |||
| d6047dc471 | |||
| 3724c3000c | |||
| 38f28c9e3a | |||
| 5b3134f094 | |||
| 85efea0363 | |||
| dd8b5b9dc6 | |||
| 5775bbc2af | |||
| 0a9707d68f | |||
| c1c2f93793 | |||
| 3454df7198 | |||
| 5545e1bc43 | |||
| 367b516abd | |||
| de0957a62b | |||
| 9ce6b9092c | |||
| 7e32ee3482 | |||
| 0d188c8228 | |||
| 840d01e1b0 | |||
| 5c39ae71a7 |
+30
-12
@@ -1,4 +1,27 @@
|
||||
.DS_Store
|
||||
## Build generated
|
||||
build/
|
||||
DerivedData
|
||||
|
||||
## Various settings
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
xcuserdata
|
||||
|
||||
## Other
|
||||
*.xccheckout
|
||||
*.moved-aside
|
||||
*.xcuserstate
|
||||
*.xcscmblueprint
|
||||
|
||||
## Obj-C/Swift specific
|
||||
*.hmap
|
||||
*.ipa
|
||||
|
||||
*.xcuserstate
|
||||
|
||||
@@ -11,20 +34,15 @@ xcuserdata/
|
||||
|
||||
.DS_Store
|
||||
*.DS_Store
|
||||
build/
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
|
||||
*.xcworkspace
|
||||
!default.xcworkspace
|
||||
xcuserdata
|
||||
profile
|
||||
*.moved-aside
|
||||
DerivedData
|
||||
.idea/
|
||||
*.LSOverride
|
||||
|
||||
# Cocoapods
|
||||
|
||||
Pods
|
||||
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
# VIMVideoPlayer
|
||||
|
||||
`VIMVideoPlayer` is a simple wrapper around the [`AVPlayer`](https://developer.apple.com/library/prerelease/ios/documentation/AVFoundation/Reference/AVPlayer_Class/index.html) and [`AVPlayerLayer`](https://developer.apple.com/library/prerelease/ios/documentation/AVFoundation/Reference/AVPlayerLayer_Class/index.html#//apple_ref/occ/cl/AVPlayerLayer) classes.
|
||||
`VIMVideoPlayer` is a simple wrapper around the [`AVPlayer`](https://developer.apple.com/library/prerelease/ios/documentation/AVFoundation/Reference/AVPlayer_Class/index.html) and [`AVPlayerLayer`](https://developer.apple.com/library/prerelease/ios/documentation/AVFoundation/Reference/AVPlayerLayer_Class/index.html#//apple_ref/occ/cl/AVPlayerLayer) classes. Check out the [Pegasus](https://github.com/vimeo/Pegasus) project for a demo.
|
||||
|
||||
## Setup
|
||||
|
||||
Add the `VIMVideoPlayerView` and `VIMVideoPlayer` classes to your project.
|
||||
|
||||
Do this by including it as a git submodule or by using cocoapods:
|
||||
|
||||
```Ruby
|
||||
# Add this to your podfile
|
||||
target 'MyTarget' do
|
||||
pod 'VIMVideoPlayer', '5.4.2'
|
||||
end
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Create a new `VIMVideoPlayerView` and add it to your view hierarchy:
|
||||
@@ -76,7 +85,7 @@ Optionally implement the `VIMVideoPlayerViewDelegate` protocol methods:
|
||||
|
||||
See `VIMVideoPlayer.h` for additional configuration options and functionality.
|
||||
|
||||
See `VIMVideoPlayerViewController` for an example of how to encapsulate a `VIMVideoPlayerView` instance with playback controls (play/pause/seek/airplay etc).
|
||||
See the [Pegasus](https://github.com/vimeo/Pegasus) project for an example of how to encapsulate a `VIMVideoPlayerView` instance with playback controls (play/pause/seek/airplay etc).
|
||||
|
||||
## License
|
||||
|
||||
|
||||
+10
-83
@@ -8,56 +8,26 @@
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
|
||||
# ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
|
||||
#
|
||||
# These will help people to find your library, and whilst it
|
||||
# can feel like a chore to fill in it's definitely to your advantage. The
|
||||
# summary should be tweet-length, and the description more in depth.
|
||||
#
|
||||
|
||||
s.name = "VIMVideoPlayer"
|
||||
s.version = "0.0.1"
|
||||
s.version = "5.6.0"
|
||||
s.summary = "A simple wrapper around the AVPlayer and AVPlayerLayer classes."
|
||||
|
||||
s.description = <<-DESC
|
||||
VIMVideoPlayer is a simple wrapper around the AVPlayer and AVPlayerLayer classes. Check out the README for details. And the Pegasus project for a demo.
|
||||
DESC
|
||||
|
||||
s.homepage = "https://github.com/vimeo/VIMVideoPlayer"
|
||||
# s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif"
|
||||
|
||||
|
||||
# ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
|
||||
#
|
||||
# Licensing your code is important. See http://choosealicense.com for more info.
|
||||
# CocoaPods will detect a license file if there is a named LICENSE*
|
||||
# Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'.
|
||||
#
|
||||
|
||||
s.license = "MIT"
|
||||
s.license = { :type => "MIT", :file => "LICENSE.md" }
|
||||
|
||||
s.authors = { "Alfie Hanssen" => "alfiehanssen@gmail.com",
|
||||
"Rob Huebner" => "robh@vimeo.com",
|
||||
"Gavin King" => "gavin@vimeo.com",
|
||||
"Kashif Muhammad" => "support@vimeo.com",
|
||||
"Andrew Whitcomb" => "support@vimeo.com",
|
||||
"Stephen Fredieu" => "support@vimeo.com",
|
||||
"Rahul Kumar" => "support@vimeo.com" }
|
||||
|
||||
# ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
|
||||
#
|
||||
# Specify the authors of the library, with email addresses. Email addresses
|
||||
# of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also
|
||||
# accepts just a name if you'd rather not provide an email address.
|
||||
#
|
||||
# Specify a social_media_url where others can refer to, for example a twitter
|
||||
# profile URL.
|
||||
#
|
||||
|
||||
s.author = { "Alfie Hanssen" => "alfiehanssen@gmail.com" }
|
||||
# Or just: s.author = "Alfie Hanssen"
|
||||
# s.authors = { "Alfie Hanssen" => "alfiehanssen@gmail.com" }
|
||||
# s.social_media_url = "http://twitter.com/vimeo
|
||||
|
||||
# ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
|
||||
#
|
||||
# If this Pod runs only on iOS or OS X, then specify the platform and
|
||||
# the deployment target. You can optionally include the target after the platform.
|
||||
#
|
||||
s.social_media_url = "http://twitter.com/vimeo"
|
||||
|
||||
# s.platform = :ios
|
||||
# s.platform = :ios, "7.0"
|
||||
@@ -67,43 +37,10 @@ Pod::Spec.new do |s|
|
||||
# s.osx.deployment_target = "10.7"
|
||||
|
||||
|
||||
# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
|
||||
#
|
||||
# Specify the location from where the source should be retrieved.
|
||||
# Supports git, hg, bzr, svn and HTTP.
|
||||
#
|
||||
|
||||
s.source = { :git => "https://github.com/vimeo/VIMVideoPlayer.git", :branch => "cocoapods" }
|
||||
|
||||
|
||||
# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
|
||||
#
|
||||
# CocoaPods is smart about how it includes source code. For source files
|
||||
# giving a folder will include any swift, h, m, mm, c & cpp files.
|
||||
# For header files it will include any header in the folder.
|
||||
# Not including the public_header_files will make all headers public.
|
||||
#
|
||||
|
||||
s.source = { :git => "https://github.com/vimeo/VIMVideoPlayer.git", :tag => s.version.to_s }
|
||||
s.source_files = "VIMVideoPlayer", "VIMVideoPlayer/*.{h,m}"
|
||||
s.exclude_files = "VIMVideoPlayer/Exclude"
|
||||
|
||||
# s.public_header_files = "Classes/**/*.h"
|
||||
|
||||
|
||||
# ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
|
||||
#
|
||||
# A list of resources included with the Pod. These are copied into the
|
||||
# target bundle with a build phase script. Anything else will be cleaned.
|
||||
# You can preserve files from being cleaned, please don't preserve
|
||||
# non-essential files like tests, examples and documentation.
|
||||
#
|
||||
|
||||
# s.resource = "icon.png"
|
||||
# s.resources = "Resources/*.png"
|
||||
|
||||
# s.preserve_paths = "FilesToSave", "MoreFilesToSave"
|
||||
|
||||
|
||||
# ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
|
||||
#
|
||||
# Link your library with frameworks, or libraries. Libraries do not include
|
||||
@@ -116,16 +53,6 @@ Pod::Spec.new do |s|
|
||||
# s.library = "iconv"
|
||||
# s.libraries = "iconv", "xml2"
|
||||
|
||||
|
||||
# ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
|
||||
#
|
||||
# If your library depends on compiler flags you can set them in the xcconfig hash
|
||||
# where they will only apply to your library. If you depend on other Podspecs
|
||||
# you can include multiple dependencies to ensure it works.
|
||||
|
||||
s.requires_arc = true
|
||||
|
||||
# s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
|
||||
# s.dependency "AFNetworking", "~> 2.5.3"
|
||||
|
||||
end
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
50E5070C1B1E23A600DF1F7A /* libVIMVideoPlayer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 50E507001B1E23A600DF1F7A /* libVIMVideoPlayer.a */; };
|
||||
501A3B931BA205A20059040B /* VIMVideoPlayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 501A3B921BA205A20059040B /* VIMVideoPlayerTests.m */; };
|
||||
501A3B951BA205A20059040B /* libVIMVideoPlayer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 50E507001B1E23A600DF1F7A /* libVIMVideoPlayer.a */; settings = {ASSET_TAGS = (); }; };
|
||||
50E5071E1B1E23E100DF1F7A /* VIMVideoPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 50E5071B1B1E23E100DF1F7A /* VIMVideoPlayer.m */; };
|
||||
50E5071F1B1E23E100DF1F7A /* VIMVideoPlayerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 50E5071D1B1E23E100DF1F7A /* VIMVideoPlayerView.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
50E5070D1B1E23A600DF1F7A /* PBXContainerItemProxy */ = {
|
||||
501A3B961BA205A20059040B /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 50E506F81B1E23A600DF1F7A /* Project object */;
|
||||
proxyType = 1;
|
||||
@@ -35,9 +36,10 @@
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
501A3B901BA205A20059040B /* VIMVideoPlayerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = VIMVideoPlayerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
501A3B921BA205A20059040B /* VIMVideoPlayerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VIMVideoPlayerTests.m; sourceTree = "<group>"; };
|
||||
501A3B941BA205A20059040B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
50E507001B1E23A600DF1F7A /* libVIMVideoPlayer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libVIMVideoPlayer.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
50E5070B1B1E23A600DF1F7A /* VIMVideoPlayerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = VIMVideoPlayerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
50E507111B1E23A600DF1F7A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
50E5071A1B1E23E100DF1F7A /* VIMVideoPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VIMVideoPlayer.h; sourceTree = "<group>"; };
|
||||
50E5071B1B1E23E100DF1F7A /* VIMVideoPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VIMVideoPlayer.m; sourceTree = "<group>"; };
|
||||
50E5071C1B1E23E100DF1F7A /* VIMVideoPlayerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VIMVideoPlayerView.h; sourceTree = "<group>"; };
|
||||
@@ -45,6 +47,14 @@
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
501A3B8D1BA205A20059040B /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
501A3B951BA205A20059040B /* libVIMVideoPlayer.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
50E506FD1B1E23A600DF1F7A /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -52,22 +62,23 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
50E507081B1E23A600DF1F7A /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
50E5070C1B1E23A600DF1F7A /* libVIMVideoPlayer.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
501A3B911BA205A20059040B /* VIMVideoPlayerTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
501A3B921BA205A20059040B /* VIMVideoPlayerTests.m */,
|
||||
501A3B941BA205A20059040B /* Info.plist */,
|
||||
);
|
||||
path = VIMVideoPlayerTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
50E506F71B1E23A600DF1F7A = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
50E507021B1E23A600DF1F7A /* VIMVideoPlayer */,
|
||||
50E5070F1B1E23A600DF1F7A /* VIMVideoPlayerTests */,
|
||||
501A3B911BA205A20059040B /* VIMVideoPlayerTests */,
|
||||
50E507011B1E23A600DF1F7A /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
@@ -76,7 +87,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
50E507001B1E23A600DF1F7A /* libVIMVideoPlayer.a */,
|
||||
50E5070B1B1E23A600DF1F7A /* VIMVideoPlayerTests.xctest */,
|
||||
501A3B901BA205A20059040B /* VIMVideoPlayerTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -92,25 +103,27 @@
|
||||
path = VIMVideoPlayer;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
50E5070F1B1E23A600DF1F7A /* VIMVideoPlayerTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
50E507101B1E23A600DF1F7A /* Supporting Files */,
|
||||
);
|
||||
path = VIMVideoPlayerTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
50E507101B1E23A600DF1F7A /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
50E507111B1E23A600DF1F7A /* Info.plist */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
501A3B8F1BA205A20059040B /* VIMVideoPlayerTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 501A3B981BA205A20059040B /* Build configuration list for PBXNativeTarget "VIMVideoPlayerTests" */;
|
||||
buildPhases = (
|
||||
501A3B8C1BA205A20059040B /* Sources */,
|
||||
501A3B8D1BA205A20059040B /* Frameworks */,
|
||||
501A3B8E1BA205A20059040B /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
501A3B971BA205A20059040B /* PBXTargetDependency */,
|
||||
);
|
||||
name = VIMVideoPlayerTests;
|
||||
productName = VIMVideoPlayerTests;
|
||||
productReference = 501A3B901BA205A20059040B /* VIMVideoPlayerTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
50E506FF1B1E23A600DF1F7A /* VIMVideoPlayer */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 50E507141B1E23A600DF1F7A /* Build configuration list for PBXNativeTarget "VIMVideoPlayer" */;
|
||||
@@ -128,24 +141,6 @@
|
||||
productReference = 50E507001B1E23A600DF1F7A /* libVIMVideoPlayer.a */;
|
||||
productType = "com.apple.product-type.library.static";
|
||||
};
|
||||
50E5070A1B1E23A600DF1F7A /* VIMVideoPlayerTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 50E507171B1E23A600DF1F7A /* Build configuration list for PBXNativeTarget "VIMVideoPlayerTests" */;
|
||||
buildPhases = (
|
||||
50E507071B1E23A600DF1F7A /* Sources */,
|
||||
50E507081B1E23A600DF1F7A /* Frameworks */,
|
||||
50E507091B1E23A600DF1F7A /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
50E5070E1B1E23A600DF1F7A /* PBXTargetDependency */,
|
||||
);
|
||||
name = VIMVideoPlayerTests;
|
||||
productName = VIMVideoPlayerTests;
|
||||
productReference = 50E5070B1B1E23A600DF1F7A /* VIMVideoPlayerTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
@@ -155,10 +150,10 @@
|
||||
LastUpgradeCheck = 0630;
|
||||
ORGANIZATIONNAME = Vimeo;
|
||||
TargetAttributes = {
|
||||
50E506FF1B1E23A600DF1F7A = {
|
||||
CreatedOnToolsVersion = 6.3.1;
|
||||
501A3B8F1BA205A20059040B = {
|
||||
CreatedOnToolsVersion = 7.0;
|
||||
};
|
||||
50E5070A1B1E23A600DF1F7A = {
|
||||
50E506FF1B1E23A600DF1F7A = {
|
||||
CreatedOnToolsVersion = 6.3.1;
|
||||
};
|
||||
};
|
||||
@@ -176,13 +171,13 @@
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
50E506FF1B1E23A600DF1F7A /* VIMVideoPlayer */,
|
||||
50E5070A1B1E23A600DF1F7A /* VIMVideoPlayerTests */,
|
||||
501A3B8F1BA205A20059040B /* VIMVideoPlayerTests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
50E507091B1E23A600DF1F7A /* Resources */ = {
|
||||
501A3B8E1BA205A20059040B /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
@@ -192,6 +187,14 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
501A3B8C1BA205A20059040B /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
501A3B931BA205A20059040B /* VIMVideoPlayerTests.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
50E506FC1B1E23A600DF1F7A /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -201,24 +204,41 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
50E507071B1E23A600DF1F7A /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
50E5070E1B1E23A600DF1F7A /* PBXTargetDependency */ = {
|
||||
501A3B971BA205A20059040B /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 50E506FF1B1E23A600DF1F7A /* VIMVideoPlayer */;
|
||||
targetProxy = 50E5070D1B1E23A600DF1F7A /* PBXContainerItemProxy */;
|
||||
targetProxy = 501A3B961BA205A20059040B /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
501A3B991BA205A20059040B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
INFOPLIST_FILE = VIMVideoPlayerTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.vimeo.VIMVideoPlayerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
501A3B9A1BA205A20059040B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
INFOPLIST_FILE = VIMVideoPlayerTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.vimeo.VIMVideoPlayerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
50E507121B1E23A600DF1F7A /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
@@ -315,41 +335,17 @@
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
50E507181B1E23A600DF1F7A /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(SDKROOT)/Developer/Library/Frameworks",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
INFOPLIST_FILE = VIMVideoPlayerTests/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
50E507191B1E23A600DF1F7A /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(SDKROOT)/Developer/Library/Frameworks",
|
||||
"$(inherited)",
|
||||
);
|
||||
INFOPLIST_FILE = VIMVideoPlayerTests/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
501A3B981BA205A20059040B /* Build configuration list for PBXNativeTarget "VIMVideoPlayerTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
501A3B991BA205A20059040B /* Debug */,
|
||||
501A3B9A1BA205A20059040B /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
};
|
||||
50E506FB1B1E23A600DF1F7A /* Build configuration list for PBXProject "VIMVideoPlayer" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
@@ -368,15 +364,6 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
50E507171B1E23A600DF1F7A /* Build configuration list for PBXNativeTarget "VIMVideoPlayerTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
50E507181B1E23A600DF1F7A /* Debug */,
|
||||
50E507191B1E23A600DF1F7A /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 50E506F81B1E23A600DF1F7A /* Project object */;
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0700"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "50E506FF1B1E23A600DF1F7A"
|
||||
BuildableName = "libVIMVideoPlayer.a"
|
||||
BlueprintName = "VIMVideoPlayer"
|
||||
ReferencedContainer = "container:VIMVideoPlayer.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
codeCoverageEnabled = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "501A3B8F1BA205A20059040B"
|
||||
BuildableName = "VIMVideoPlayerTests.xctest"
|
||||
BlueprintName = "VIMVideoPlayerTests"
|
||||
ReferencedContainer = "container:VIMVideoPlayer.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "50E506FF1B1E23A600DF1F7A"
|
||||
BuildableName = "libVIMVideoPlayer.a"
|
||||
BlueprintName = "VIMVideoPlayer"
|
||||
ReferencedContainer = "container:VIMVideoPlayer.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "50E506FF1B1E23A600DF1F7A"
|
||||
BuildableName = "libVIMVideoPlayer.a"
|
||||
BlueprintName = "VIMVideoPlayer"
|
||||
ReferencedContainer = "container:VIMVideoPlayer.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "50E506FF1B1E23A600DF1F7A"
|
||||
BuildableName = "libVIMVideoPlayer.a"
|
||||
BlueprintName = "VIMVideoPlayer"
|
||||
ReferencedContainer = "container:VIMVideoPlayer.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -55,6 +55,8 @@ static void *VideoPlayer_PlayerItemLoadedTimeRangesContext = &VideoPlayer_Player
|
||||
@property (nonatomic, assign) BOOL isTimingUpdateEnabled;
|
||||
@property (nonatomic, strong) id timeObserverToken;
|
||||
|
||||
@property (nonatomic, strong) AVPlayerItem *item;
|
||||
|
||||
@end
|
||||
|
||||
@implementation VIMVideoPlayer
|
||||
@@ -68,8 +70,6 @@ static void *VideoPlayer_PlayerItemLoadedTimeRangesContext = &VideoPlayer_Player
|
||||
[self removeTimeObserver];
|
||||
|
||||
[self cancelFadeVolume];
|
||||
|
||||
NSLog(@"dealloc");
|
||||
}
|
||||
|
||||
- (instancetype)init
|
||||
@@ -94,7 +94,7 @@ static void *VideoPlayer_PlayerItemLoadedTimeRangesContext = &VideoPlayer_Player
|
||||
|
||||
- (void)setupPlayer
|
||||
{
|
||||
self.player = [AVPlayer playerWithPlayerItem:nil];
|
||||
self.player = [[AVPlayer alloc] init];
|
||||
self.player.muted = NO;
|
||||
self.player.allowsExternalPlayback = YES;
|
||||
}
|
||||
@@ -407,11 +407,13 @@ static void *VideoPlayer_PlayerItemLoadedTimeRangesContext = &VideoPlayer_Player
|
||||
|
||||
- (void)resetPlayerItemIfNecessary
|
||||
{
|
||||
if (self.player.currentItem)
|
||||
if (self.item)
|
||||
{
|
||||
[self removePlayerItemObservers:self.player.currentItem];
|
||||
[self removePlayerItemObservers:self.item];
|
||||
|
||||
[self.player replaceCurrentItemWithPlayerItem:nil];
|
||||
|
||||
self.item = nil;
|
||||
}
|
||||
|
||||
_volumeFadeDuration = DefaultVolumeFadeDuration;
|
||||
@@ -424,6 +426,10 @@ static void *VideoPlayer_PlayerItemLoadedTimeRangesContext = &VideoPlayer_Player
|
||||
|
||||
- (void)preparePlayerItem:(AVPlayerItem *)playerItem
|
||||
{
|
||||
NSParameterAssert(playerItem);
|
||||
|
||||
self.item = playerItem;
|
||||
|
||||
[self addPlayerItemObservers:playerItem];
|
||||
|
||||
[self.player replaceCurrentItemWithPlayerItem:playerItem];
|
||||
@@ -702,14 +708,25 @@ static void *VideoPlayer_PlayerItemLoadedTimeRangesContext = &VideoPlayer_Player
|
||||
}
|
||||
case AVPlayerItemStatusFailed:
|
||||
{
|
||||
NSLog(@"Video player Status Failed: error = %@", self.player.currentItem.error);
|
||||
NSLog(@"Video player Status Failed: player item error = %@", self.player.currentItem.error);
|
||||
NSLog(@"Video player Status Failed: player error = %@", self.player.error);
|
||||
|
||||
NSError *error = self.player.error;
|
||||
if (!error)
|
||||
{
|
||||
error = self.player.currentItem.error;
|
||||
}
|
||||
else
|
||||
{
|
||||
error = [NSError errorWithDomain:kVideoPlayerErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey : @"unknown player error, status == AVPlayerItemStatusFailed"}];
|
||||
}
|
||||
|
||||
[self reset];
|
||||
|
||||
if ([self.delegate respondsToSelector:@selector(videoPlayer:didFailWithError:)])
|
||||
{
|
||||
[self reset];
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self.delegate videoPlayer:self didFailWithError:self.player.currentItem.error];
|
||||
[self.delegate videoPlayer:self didFailWithError:error];
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -40,21 +40,39 @@
|
||||
[self detachPlayer];
|
||||
}
|
||||
|
||||
- (instancetype)init
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super init];
|
||||
self = [super initWithFrame:frame];
|
||||
|
||||
if (self)
|
||||
{
|
||||
_player = [[VIMVideoPlayer alloc] init];
|
||||
_player.muted = YES;
|
||||
_player.looping = YES;
|
||||
|
||||
[self attachPlayer];
|
||||
[self commonInit];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithCoder:(NSCoder *)aDecoder
|
||||
{
|
||||
self = [super initWithCoder:aDecoder];
|
||||
|
||||
if (self)
|
||||
{
|
||||
[self commonInit];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)commonInit
|
||||
{
|
||||
_player = [[VIMVideoPlayer alloc] init];
|
||||
_player.muted = YES;
|
||||
_player.looping = YES;
|
||||
|
||||
[self attachPlayer];
|
||||
}
|
||||
|
||||
#pragma mark - Public API
|
||||
|
||||
- (void)setPlayer:(VIMVideoPlayer *)player
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.vimeo.$(PRODUCT_NAME:rfc1034identifier)</string>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// VIMVideoPlayerTests.m
|
||||
// VIMVideoPlayerTests
|
||||
//
|
||||
// Created by Hanssen, Alfie on 9/10/15.
|
||||
// Copyright © 2015 Vimeo. All rights reserved.
|
||||
//
|
||||
|
||||
#import <XCTest/XCTest.h>
|
||||
|
||||
@interface VIMVideoPlayerTests : XCTestCase
|
||||
|
||||
@end
|
||||
|
||||
@implementation VIMVideoPlayerTests
|
||||
|
||||
- (void)setUp {
|
||||
[super setUp];
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
- (void)tearDown {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
[super tearDown];
|
||||
}
|
||||
|
||||
- (void)testExample {
|
||||
// This is an example of a functional test case.
|
||||
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
||||
}
|
||||
|
||||
- (void)testPerformanceExample {
|
||||
// This is an example of a performance test case.
|
||||
[self measureBlock:^{
|
||||
// Put the code you want to measure the time of here.
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user