2 Commits

Author SHA1 Message Date
Jose Quintero 263b97a4a7 podspec update 2018-11-08 17:51:12 -06:00
Jose Quintero fa8f1b6ada Updated for VersaPlayer 2.1.3 2018-11-08 17:50:07 -06:00
49 changed files with 1707 additions and 990 deletions
+5 -5
View File
@@ -5,8 +5,8 @@ PODS:
- FBSnapshotTestCase/SwiftSupport (2.1.4):
- FBSnapshotTestCase/Core
- GoogleAds-IMA-iOS-SDK (3.7.3)
- VersaPlayer (1.2.1)
- VersaPlayerAdsExtension (0.4.2):
- VersaPlayer (2.1.3)
- VersaPlayerAdsExtension (0.5.1):
- GoogleAds-IMA-iOS-SDK
- VersaPlayer
@@ -29,9 +29,9 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
FBSnapshotTestCase: 094f9f314decbabe373b87cc339bea235a63e07a
GoogleAds-IMA-iOS-SDK: 6dc764910309dcc982d6eb8b7de19d3cf94a6857
VersaPlayer: ae33859d21559ff631b0dfb159f212af70631ef2
VersaPlayerAdsExtension: b1a11b51db5acb21635a9bf6d31a5493ec4918b3
VersaPlayer: 544b1bd4f4faac6bd53d8e4b5ee0461da4f273e5
VersaPlayerAdsExtension: edbac70440e728d806d427c9869546163cfe6956
PODFILE CHECKSUM: 4421772df42864a0ee29f9f0ad1ed63a0f1a6d75
COCOAPODS: 1.5.3
COCOAPODS: 1.6.0.beta.2
@@ -1,6 +1,6 @@
{
"name": "VersaPlayerAdsExtension",
"version": "0.4.2",
"version": "0.5.1",
"summary": "VersaPlayer Extension to enable video ads.",
"description": "VersaPlayer Extension to enable video ads functionality.",
"homepage": "https://github.com/josejuanqm/VersaPlayerAdsExtension",
@@ -13,7 +13,7 @@
},
"source": {
"git": "https://github.com/josejuanqm/VersaPlayerAdsExtension.git",
"tag": "0.4.2"
"tag": "0.5.1"
},
"social_media_url": "https://twitter.com/josejuanqm",
"platforms": {
+5 -5
View File
@@ -5,8 +5,8 @@ PODS:
- FBSnapshotTestCase/SwiftSupport (2.1.4):
- FBSnapshotTestCase/Core
- GoogleAds-IMA-iOS-SDK (3.7.3)
- VersaPlayer (1.2.1)
- VersaPlayerAdsExtension (0.4.2):
- VersaPlayer (2.1.3)
- VersaPlayerAdsExtension (0.5.1):
- GoogleAds-IMA-iOS-SDK
- VersaPlayer
@@ -29,9 +29,9 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
FBSnapshotTestCase: 094f9f314decbabe373b87cc339bea235a63e07a
GoogleAds-IMA-iOS-SDK: 6dc764910309dcc982d6eb8b7de19d3cf94a6857
VersaPlayer: ae33859d21559ff631b0dfb159f212af70631ef2
VersaPlayerAdsExtension: b1a11b51db5acb21635a9bf6d31a5493ec4918b3
VersaPlayer: 544b1bd4f4faac6bd53d8e4b5ee0461da4f273e5
VersaPlayerAdsExtension: edbac70440e728d806d427c9869546163cfe6956
PODFILE CHECKSUM: 4421772df42864a0ee29f9f0ad1ed63a0f1a6d75
COCOAPODS: 1.5.3
COCOAPODS: 1.6.0.beta.2
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,26 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.1.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
@@ -1,9 +1,9 @@
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/FBSnapshotTestCase
ENABLE_BITCODE = NO
FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"
FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
OTHER_LDFLAGS = -framework "Foundation" -framework "QuartzCore" -framework "UIKit" -framework "XCTest"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "QuartzCore" -framework "UIKit" -framework "XCTest"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
@@ -0,0 +1,10 @@
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/GoogleAds-IMA-iOS-SDK
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/GoogleAds-IMA-iOS-SDK"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
OTHER_LDFLAGS = $(inherited) -framework "AVFoundation" -framework "AdSupport" -framework "AudioToolbox" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreMedia" -framework "GoogleInteractiveMediaAds" -framework "MessageUI" -framework "QuartzCore" -framework "SystemConfiguration" -framework "UIKit" -weak_framework "WebKit"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/GoogleAds-IMA-iOS-SDK
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES
@@ -0,0 +1,26 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
@@ -8,7 +8,7 @@ Copyright 2015 Google, Inc. All rights reserved.
## VersaPlayer
Copyright (c) 2018 jose.juan.qm@gmail.com <jose.quintero@fox.com>
Copyright (c) 2018 jose.juan.qm@gmail.com <jose.juan.qm@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -25,7 +25,7 @@
</dict>
<dict>
<key>FooterText</key>
<string>Copyright (c) 2018 jose.juan.qm@gmail.com &lt;jose.quintero@fox.com&gt;
<string>Copyright (c) 2018 jose.juan.qm@gmail.com &lt;jose.juan.qm@gmail.com&gt;
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -3,10 +3,15 @@ set -e
set -u
set -o pipefail
function on_error {
echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
}
trap 'on_error $LINENO' ERR
if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
# If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
# frameworks to, so exit 0 (signalling the script phase was successful).
exit 0
# If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
# frameworks to, so exit 0 (signalling the script phase was successful).
exit 0
fi
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
@@ -36,8 +41,8 @@ install_framework()
local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
echo "Symlinked..."
source="$(readlink "${source}")"
fi
# Use filter instead of exclude so missing patterns don't throw errors.
@@ -47,8 +52,13 @@ install_framework()
local basename
basename="$(basename -s .framework "$1")"
binary="${destination}/${basename}.framework/${basename}"
if ! [ -r "$binary" ]; then
binary="${destination}/${basename}"
elif [ -L "${binary}" ]; then
echo "Destination binary is symlinked..."
dirname="$(dirname "${binary}")"
binary="${dirname}/$(readlink "${binary}")"
fi
# Strip invalid architectures so "fat" simulator / device frameworks work on device
@@ -62,7 +72,7 @@ install_framework()
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u)
for lib in $swift_runtime_libs; do
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
@@ -101,8 +111,8 @@ install_dsym() {
# Signs a framework with the provided identity
code_sign_if_enabled() {
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
# Use the current code_sign_identitiy
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
# Use the current code_sign_identity
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
@@ -131,7 +141,7 @@ strip_invalid_archs() {
for arch in $binary_archs; do
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
lipo -remove "$arch" -output "$binary" "$binary"
stripped="$stripped $arch"
fi
done
@@ -1,10 +1,10 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayer" "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayerAdsExtension" "${PODS_ROOT}/GoogleAds-IMA-iOS-SDK"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayer/VersaPlayer.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayerAdsExtension/VersaPlayerAdsExtension.framework/Headers"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayer/VersaPlayer.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayerAdsExtension/VersaPlayerAdsExtension.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "AVFoundation" -framework "AdSupport" -framework "AudioToolbox" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreMedia" -framework "GoogleInteractiveMediaAds" -framework "MessageUI" -framework "QuartzCore" -framework "SystemConfiguration" -framework "UIKit" -framework "VersaPlayer" -framework "VersaPlayerAdsExtension" -weak_framework "WebKit"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
@@ -1,10 +1,10 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayer" "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayerAdsExtension" "${PODS_ROOT}/GoogleAds-IMA-iOS-SDK"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayer/VersaPlayer.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayerAdsExtension/VersaPlayerAdsExtension.framework/Headers"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayer/VersaPlayer.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayerAdsExtension/VersaPlayerAdsExtension.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "AVFoundation" -framework "AdSupport" -framework "AudioToolbox" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreMedia" -framework "GoogleInteractiveMediaAds" -framework "MessageUI" -framework "QuartzCore" -framework "SystemConfiguration" -framework "UIKit" -framework "VersaPlayer" -framework "VersaPlayerAdsExtension" -weak_framework "WebKit"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
@@ -0,0 +1,26 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
@@ -8,7 +8,7 @@ Copyright 2015 Google, Inc. All rights reserved.
## VersaPlayer
Copyright (c) 2018 jose.juan.qm@gmail.com <jose.quintero@fox.com>
Copyright (c) 2018 jose.juan.qm@gmail.com <jose.juan.qm@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -25,7 +25,7 @@
</dict>
<dict>
<key>FooterText</key>
<string>Copyright (c) 2018 jose.juan.qm@gmail.com &lt;jose.quintero@fox.com&gt;
<string>Copyright (c) 2018 jose.juan.qm@gmail.com &lt;jose.juan.qm@gmail.com&gt;
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -3,10 +3,15 @@ set -e
set -u
set -o pipefail
function on_error {
echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
}
trap 'on_error $LINENO' ERR
if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
# If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
# frameworks to, so exit 0 (signalling the script phase was successful).
exit 0
# If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
# frameworks to, so exit 0 (signalling the script phase was successful).
exit 0
fi
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
@@ -36,8 +41,8 @@ install_framework()
local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
echo "Symlinked..."
source="$(readlink "${source}")"
fi
# Use filter instead of exclude so missing patterns don't throw errors.
@@ -47,8 +52,13 @@ install_framework()
local basename
basename="$(basename -s .framework "$1")"
binary="${destination}/${basename}.framework/${basename}"
if ! [ -r "$binary" ]; then
binary="${destination}/${basename}"
elif [ -L "${binary}" ]; then
echo "Destination binary is symlinked..."
dirname="$(dirname "${binary}")"
binary="${dirname}/$(readlink "${binary}")"
fi
# Strip invalid architectures so "fat" simulator / device frameworks work on device
@@ -62,7 +72,7 @@ install_framework()
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u)
for lib in $swift_runtime_libs; do
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
@@ -101,8 +111,8 @@ install_dsym() {
# Signs a framework with the provided identity
code_sign_if_enabled() {
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
# Use the current code_sign_identitiy
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
# Use the current code_sign_identity
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
@@ -131,7 +141,7 @@ strip_invalid_archs() {
for arch in $binary_archs; do
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
lipo -remove "$arch" -output "$binary" "$binary"
stripped="$stripped $arch"
fi
done
@@ -1,10 +1,10 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) $(PLATFORM_DIR)/Developer/Library/Frameworks "${PODS_CONFIGURATION_BUILD_DIR}/FBSnapshotTestCase" "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayer" "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayer" "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayerAdsExtension" "${PODS_ROOT}/GoogleAds-IMA-iOS-SDK"
FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" "${PODS_CONFIGURATION_BUILD_DIR}/FBSnapshotTestCase" "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayer" "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayerAdsExtension" "${PODS_ROOT}/GoogleAds-IMA-iOS-SDK"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FBSnapshotTestCase/FBSnapshotTestCase.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayer/VersaPlayer.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayerAdsExtension/VersaPlayerAdsExtension.framework/Headers"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/FBSnapshotTestCase/FBSnapshotTestCase.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayer/VersaPlayer.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayer/VersaPlayer.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayerAdsExtension/VersaPlayerAdsExtension.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "AVFoundation" -framework "AdSupport" -framework "AudioToolbox" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreMedia" -framework "FBSnapshotTestCase" -framework "GoogleInteractiveMediaAds" -framework "MessageUI" -framework "QuartzCore" -framework "SystemConfiguration" -framework "UIKit" -framework "VersaPlayer" -weak_framework "WebKit"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
OTHER_LDFLAGS = $(inherited) -framework "AVFoundation" -framework "AdSupport" -framework "AudioToolbox" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreMedia" -framework "FBSnapshotTestCase" -framework "Foundation" -framework "GoogleInteractiveMediaAds" -framework "MessageUI" -framework "QuartzCore" -framework "SystemConfiguration" -framework "UIKit" -framework "VersaPlayer" -framework "VersaPlayerAdsExtension" -framework "XCTest" -weak_framework "WebKit"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
@@ -1,10 +1,10 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) $(PLATFORM_DIR)/Developer/Library/Frameworks "${PODS_CONFIGURATION_BUILD_DIR}/FBSnapshotTestCase" "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayer" "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayer" "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayerAdsExtension" "${PODS_ROOT}/GoogleAds-IMA-iOS-SDK"
FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" "${PODS_CONFIGURATION_BUILD_DIR}/FBSnapshotTestCase" "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayer" "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayerAdsExtension" "${PODS_ROOT}/GoogleAds-IMA-iOS-SDK"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FBSnapshotTestCase/FBSnapshotTestCase.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayer/VersaPlayer.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayerAdsExtension/VersaPlayerAdsExtension.framework/Headers"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/FBSnapshotTestCase/FBSnapshotTestCase.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayer/VersaPlayer.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayer/VersaPlayer.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayerAdsExtension/VersaPlayerAdsExtension.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "AVFoundation" -framework "AdSupport" -framework "AudioToolbox" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreMedia" -framework "FBSnapshotTestCase" -framework "GoogleInteractiveMediaAds" -framework "MessageUI" -framework "QuartzCore" -framework "SystemConfiguration" -framework "UIKit" -framework "VersaPlayer" -weak_framework "WebKit"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
OTHER_LDFLAGS = $(inherited) -framework "AVFoundation" -framework "AdSupport" -framework "AudioToolbox" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreMedia" -framework "FBSnapshotTestCase" -framework "Foundation" -framework "GoogleInteractiveMediaAds" -framework "MessageUI" -framework "QuartzCore" -framework "SystemConfiguration" -framework "UIKit" -framework "VersaPlayer" -framework "VersaPlayerAdsExtension" -framework "XCTest" -weak_framework "WebKit"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
@@ -0,0 +1,26 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.1.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
@@ -1,6 +1,6 @@
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayer
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
@@ -0,0 +1,26 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.5.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
@@ -1,8 +1,8 @@
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayerAdsExtension
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/GoogleAds-IMA-iOS-SDK" "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayer"
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/VersaPlayer" "${PODS_ROOT}/GoogleAds-IMA-iOS-SDK"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
OTHER_LDFLAGS = -framework "GoogleInteractiveMediaAds"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
OTHER_LDFLAGS = $(inherited) -framework "AVFoundation" -framework "AdSupport" -framework "AudioToolbox" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreMedia" -framework "GoogleInteractiveMediaAds" -framework "MessageUI" -framework "QuartzCore" -framework "SystemConfiguration" -framework "UIKit" -framework "VersaPlayer" -weak_framework "WebKit"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright (c) 2018 jose.juan.qm@gmail.com <jose.quintero@fox.com>
Copyright (c) 2018 jose.juan.qm@gmail.com <jose.juan.qm@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+2 -2
View File
@@ -81,9 +81,9 @@
</ol>
</div>
## :warning: tvOS Information
## Community
If you are looking for the tvOS player, head over to https://github.com/josejuanqm/TVersaPlayer
If you have any doubts or need help with anything, head over to [Gitter](https://gitter.im/VersaPlayer/Lobby) and ask it there!
## Example
@@ -160,9 +160,9 @@ extension VersaPlayer {
if let obj = object as? VersaPlayer, obj == self {
if keyPath == "status" {
switch status {
case AVPlayerStatus.readyToPlay:
case AVPlayer.Status.readyToPlay:
handler.playbackDelegate?.playbackReady(player: self)
case AVPlayerStatus.failed:
case AVPlayer.Status.failed:
handler.playbackDelegate?.playbackDidFailed(with: VersaPlayerPlaybackError.unknown)
default:
break;
@@ -28,9 +28,12 @@ open class VersaPlayerLayer: CALayer {
public convenience init(with player: VersaPlayerView) {
self.init()
playerLayer = AVPlayerLayer.init(player: player.player)
#if os(iOS)
let controller = AVPictureInPictureController(playerLayer: playerLayer)
controller?.delegate = player
player.pipController = controller
#endif
addSublayer(playerLayer)
}
@@ -6,10 +6,14 @@
// Copyright © 2018 Quasar. All rights reserved.
//
#if os(macOS)
import Cocoa
#else
import UIKit
#endif
import AVKit
open class VersaPlayerRenderingView: UIView {
open class VersaPlayerRenderingView: View {
/// VPlayerLayer instance used to render player content
public var renderingLayer: VersaPlayerLayer!
@@ -30,7 +34,21 @@ open class VersaPlayerRenderingView: UIView {
fatalError("init(coder:) has not been implemented")
}
override open func layoutSubviews() {
#if os(macOS)
open override func layout() {
super.layout()
if renderingLayer == nil {
renderingLayer = VersaPlayerLayer.init(with: player)
layer = renderingLayer.playerLayer
}
renderingLayer.playerLayer.frame = bounds
}
#else
open override func layoutSubviews() {
super.layoutSubviews()
if renderingLayer == nil {
renderingLayer = VersaPlayerLayer.init(with: player)
@@ -39,5 +57,7 @@ open class VersaPlayerRenderingView: UIView {
renderingLayer.playerLayer.frame = bounds
}
#endif
}
@@ -0,0 +1,22 @@
//
// VersaSeekbarSlider.swift
// VersaPlayer Demo
//
// Created by Jose Quintero on 10/11/18.
// Copyright © 2018 Quasar. All rights reserved.
//
#if os(macOS)
import Cocoa
public typealias Slider = NSSlider
#elseif os(iOS)
import UIKit
public typealias Slider = UISlider
#else
import UIKit
public typealias Slider = UIProgressView
#endif
open class VersaSeekbarSlider: Slider {
}
@@ -0,0 +1,59 @@
//
// VersaRewindButton.swift
// VersaPlayer Demo
//
// Created by Jose Quintero on 10/11/18.
// Copyright © 2018 Quasar. All rights reserved.
//
#if os(macOS)
import Cocoa
#else
import UIKit
#endif
#if os(macOS)
public typealias Button = NSButton
#else
public typealias Button = UIButton
#endif
@IBDesignable
open class VersaStatefulButton: Button {
#if os(macOS)
open override var state: NSControl.StateValue {
didSet {
if state == .on {
image = activeImage
}else {
image = inactiveImage
}
}
}
@IBInspectable public var activeImage: NSImage? = nil
@IBInspectable public var inactiveImage: NSImage? = nil
#else
@IBInspectable public var activeImage: UIImage? = nil
@IBInspectable public var inactiveImage: UIImage? = nil {
didSet {
setImage(inactiveImage, for: .normal)
}
}
#endif
open func set(active: Bool) {
#if os(macOS)
state = active ? .on : .off
#else
if active {
setImage(activeImage, for: .normal)
}else {
setImage(inactiveImage, for: .normal)
}
#endif
}
}
@@ -6,9 +6,19 @@
// Copyright © 2018 Quasar. All rights reserved.
//
#if os(macOS)
import Cocoa
#else
import UIKit
#endif
open class VersaTimeLabel: UILabel {
#if os(macOS)
public typealias TextField = NSTextField
#else
public typealias TextField = UITextField
#endif
open class VersaTimeLabel: TextField {
public var timeFormat: String = "HH:mm:ss"
@@ -17,7 +27,12 @@ open class VersaTimeLabel: UILabel {
let formatter = DateFormatter()
formatter.timeZone = TimeZone.init(secondsFromGMT: 0)
formatter.dateFormat = timeFormat
#if os(macOS)
stringValue = formatter.string(from: date)
#else
text = formatter.string(from: date)
#endif
}
}
@@ -6,8 +6,12 @@
// Copyright © 2018 Quasar. All rights reserved.
//
import Foundation
#if os(macOS)
import Cocoa
#else
import UIKit
#endif
import Foundation
open class VersaPlayerControlsBehaviour {
@@ -63,20 +67,21 @@ open class VersaPlayerControlsBehaviour {
/// Default activation block
open func defaultActivationBlock() {
controls.isHidden = false
UIView.animate(withDuration: 0.3, animations: {
self.controls.alpha = 1
})
#if os(macOS)
controls.alphaValue = 1
#else
controls.alpha = 1
#endif
}
/// Default deactivation block
open func defaultDeactivationBlock() {
UIView.animate(withDuration: 0.3, animations: {
self.controls.alpha = 0
}, completion: {
if $0 {
self.controls.isHidden = true
}
})
controls.isHidden = true
#if os(macOS)
controls.alphaValue = 0
#else
controls.alpha = 0
#endif
}
/// Hide the controls
@@ -0,0 +1,284 @@
//
// VersaPlayerGestureRecieverView.swift
// VersaPlayerView Demo
//
// Created by Jose Quintero on 10/11/18.
// Copyright © 2018 Quasar. All rights reserved.
//
#if os(macOS)
import Cocoa
#else
import UIKit
#endif
#if os(macOS)
open class VersaPlayerGestureRecieverView: View {
/// VersaPlayerGestureRecieverViewDelegate instance
public var delegate: VersaPlayerGestureRecieverViewDelegate? = nil
/// Single tap UITapGestureRecognizer
public var tapGesture: NSClickGestureRecognizer? = nil
/// Double tap UITapGestureRecognizer
public var doubleTapGesture: NSClickGestureRecognizer? = nil
/// UIPanGestureRecognizer
public var panGesture: NSPanGestureRecognizer? = nil
/// UIPinchGestureRecognizer
public var pinchGesture: NSMagnificationGestureRecognizer? = nil
/// Whether or not reciever view is ready
public var ready: Bool = false
/// Pan gesture initial point
public var panGestureInitialPoint: CGPoint = CGPoint.zero
open override func viewDidMoveToSuperview() {
super.viewDidMoveToSuperview()
translatesAutoresizingMaskIntoConstraints = false
if let parent = superview {
topAnchor.constraint(equalTo: parent.topAnchor).isActive = true
leftAnchor.constraint(equalTo: parent.leftAnchor).isActive = true
rightAnchor.constraint(equalTo: parent.rightAnchor).isActive = true
bottomAnchor.constraint(equalTo: parent.bottomAnchor).isActive = true
}
if !ready {
prepare()
}
}
/// Prepare the view gesture recognizers
open func prepare() {
ready = true
tapGesture = NSClickGestureRecognizer(target: self, action: #selector(tapHandler(with:)))
tapGesture?.numberOfClicksRequired = 1
doubleTapGesture = NSClickGestureRecognizer(target: self, action: #selector(doubleTapHandler(with:)))
doubleTapGesture?.numberOfClicksRequired = 2
tapGesture?.shouldBeRequiredToFail(by: tapGesture!)
pinchGesture = NSMagnificationGestureRecognizer(target: self, action: #selector(pinchHandler(with:)))
panGesture = NSPanGestureRecognizer(target: self, action: #selector(panHandler(with:)))
panGesture?.numberOfTouchesRequired = 1
addGestureRecognizer(tapGesture!)
addGestureRecognizer(doubleTapGesture!)
addGestureRecognizer(panGesture!)
addGestureRecognizer(pinchGesture!)
}
@objc open func tapHandler(with sender: NSClickGestureRecognizer) {
delegate?.didTap(at: sender.location(in: self))
}
@objc open func doubleTapHandler(with sender: NSClickGestureRecognizer) {
delegate?.didDoubleTap(at: sender.location(in: self))
}
@objc open func pinchHandler(with sender: NSMagnificationGestureRecognizer) {
if sender.state == .ended {
delegate?.didPinch(with: sender.magnification)
}
}
@objc open func panHandler(with sender: NSPanGestureRecognizer) {
if sender.state == .began {
panGestureInitialPoint = sender.location(in: self)
}
delegate?.didPan(with: sender.translation(in: self), initially: panGestureInitialPoint)
}
}
#elseif os(iOS)
open class VersaPlayerGestureRecieverView: UIView {
/// VersaPlayerGestureRecieverViewDelegate instance
public var delegate: VersaPlayerGestureRecieverViewDelegate? = nil
/// Single tap UITapGestureRecognizer
public var tapGesture: UITapGestureRecognizer? = nil
/// Double tap UITapGestureRecognizer
public var doubleTapGesture: UITapGestureRecognizer? = nil
/// UIPanGestureRecognizer
public var panGesture: UIPanGestureRecognizer? = nil
/// UIPinchGestureRecognizer
public var pinchGesture: UIPinchGestureRecognizer? = nil
/// Whether or not reciever view is ready
public var ready: Bool = false
/// Pan gesture initial point
public var panGestureInitialPoint: CGPoint = CGPoint.zero
override open func didMoveToSuperview() {
super.didMoveToSuperview()
translatesAutoresizingMaskIntoConstraints = false
if let parent = superview {
topAnchor.constraint(equalTo: parent.topAnchor).isActive = true
leftAnchor.constraint(equalTo: parent.leftAnchor).isActive = true
rightAnchor.constraint(equalTo: parent.rightAnchor).isActive = true
bottomAnchor.constraint(equalTo: parent.bottomAnchor).isActive = true
}
if !ready {
prepare()
}
}
/// Prepare the view gesture recognizers
open func prepare() {
ready = true
isUserInteractionEnabled = true
tapGesture = UITapGestureRecognizer(target: self, action: #selector(tapHandler(with:)))
tapGesture?.numberOfTapsRequired = 1
doubleTapGesture = UITapGestureRecognizer(target: self, action: #selector(doubleTapHandler(with:)))
doubleTapGesture?.numberOfTapsRequired = 2
tapGesture?.require(toFail: doubleTapGesture!)
pinchGesture = UIPinchGestureRecognizer(target: self, action: #selector(pinchHandler(with:)))
panGesture = UIPanGestureRecognizer(target: self, action: #selector(panHandler(with:)))
panGesture?.minimumNumberOfTouches = 1
addGestureRecognizer(tapGesture!)
addGestureRecognizer(doubleTapGesture!)
addGestureRecognizer(panGesture!)
addGestureRecognizer(pinchGesture!)
}
@objc open func tapHandler(with sender: UITapGestureRecognizer) {
delegate?.didTap(at: sender.location(in: self))
}
@objc open func doubleTapHandler(with sender: UITapGestureRecognizer) {
delegate?.didDoubleTap(at: sender.location(in: self))
}
@objc open func pinchHandler(with sender: UIPinchGestureRecognizer) {
if sender.state == .ended {
delegate?.didPinch(with: sender.scale)
}
}
@objc open func panHandler(with sender: UIPanGestureRecognizer) {
if sender.state == .began {
panGestureInitialPoint = sender.location(in: self)
}
delegate?.didPan(with: sender.translation(in: self), initially: panGestureInitialPoint)
}
}
#else
open class VersaPlayerGestureRecieverView: UIView {
internal var handler: VersaPlayerView!
/// VersaPlayerGestureRecieverViewDelegate instance
public var delegate: VersaPlayerGestureRecieverViewDelegate? = nil
/// UITapGestureRecognizer
public var tapGesture: UITapGestureRecognizer? = nil
/// UIPanGestureRecognizer
public var swipeGestureUp: UISwipeGestureRecognizer? = nil
public var swipeGestureDown: UISwipeGestureRecognizer? = nil
public var swipeGestureLeft: UISwipeGestureRecognizer? = nil
public var swipeGestureRight: UISwipeGestureRecognizer? = nil
/// Whether or not reciever view is ready
public var ready: Bool = false
/// Should become focused
public var shouldBecomeFocused: Bool = true
private var initialSwipeLocation: CGPoint = .zero
open override var canBecomeFocused: Bool {
return shouldBecomeFocused
}
open override func didUpdateFocus(in context: UIFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) {
super.didUpdateFocus(in: context, with: coordinator)
}
open override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
super.touchesBegan(touches, with: event)
initialSwipeLocation = touches.first?.location(in: self) ?? .zero
}
override open func didMoveToSuperview() {
super.didMoveToSuperview()
translatesAutoresizingMaskIntoConstraints = false
if let parent = superview {
topAnchor.constraint(equalTo: parent.topAnchor).isActive = true
leftAnchor.constraint(equalTo: parent.leftAnchor).isActive = true
rightAnchor.constraint(equalTo: parent.rightAnchor).isActive = true
bottomAnchor.constraint(equalTo: parent.bottomAnchor).isActive = true
}
if !ready {
prepare()
}
}
/// Prepare the view gesture recognizers
public func prepare() {
ready = true
isUserInteractionEnabled = true
tapGesture = UITapGestureRecognizer(target: self, action: #selector(tapHandler(with:)))
tapGesture?.allowedPressTypes = [NSNumber(value: UIPress.PressType.menu.rawValue), NSNumber(value: UIPress.PressType.select.rawValue)]
tapGesture?.numberOfTapsRequired = 1
let playPause = UITapGestureRecognizer(target: self, action: #selector(togglePlayback))
playPause.allowedPressTypes = [NSNumber(value: UIPress.PressType.playPause.rawValue)]
playPause.numberOfTapsRequired = 1
swipeGestureUp = UISwipeGestureRecognizer(target: self, action: #selector(swipeHandler(with:)))
swipeGestureUp?.direction = UISwipeGestureRecognizer.Direction.up
swipeGestureDown = UISwipeGestureRecognizer(target: self, action: #selector(swipeHandler(with:)))
swipeGestureDown?.direction = UISwipeGestureRecognizer.Direction.down
swipeGestureLeft = UISwipeGestureRecognizer(target: self, action: #selector(swipeHandler(with:)))
swipeGestureLeft?.direction = UISwipeGestureRecognizer.Direction.left
swipeGestureRight = UISwipeGestureRecognizer(target: self, action: #selector(swipeHandler(with:)))
swipeGestureRight?.direction = UISwipeGestureRecognizer.Direction.right
addGestureRecognizer(tapGesture!)
addGestureRecognizer(playPause)
addGestureRecognizer(swipeGestureUp!)
addGestureRecognizer(swipeGestureDown!)
addGestureRecognizer(swipeGestureLeft!)
addGestureRecognizer(swipeGestureRight!)
}
@objc private func togglePlayback() {
self.handler.togglePlayback()
}
@objc public func tapHandler(with sender: UITapGestureRecognizer) {
delegate?.didTap(at: sender.location(in: self))
}
@objc public func swipeHandler(with sender: UISwipeGestureRecognizer) {
let direction: UISwipeGestureRecognizer.Direction = sender.direction
delegate?.didSwipe(with: direction)
}
}
#endif
@@ -6,8 +6,12 @@
// Copyright © 2018 Quasar. All rights reserved.
//
import Foundation
#if os(macOS)
import Cocoa
#else
import UIKit
#endif
import Foundation
public protocol VersaPlayerGestureRecieverViewDelegate {
@@ -35,4 +39,12 @@ public protocol VersaPlayerGestureRecieverViewDelegate {
/// - translation: translation in view
/// - at: initial point recognized
func didPan(with translation: CGPoint, initially at: CGPoint)
#if os(tvOS)
/// Swipe was recognized
///
/// - Parameters:
/// - direction: gestureDirection
func didSwipe(with direction: UISwipeGestureRecognizer.Direction)
#endif
}
@@ -6,11 +6,15 @@
// Copyright © 2018 Quasar. All rights reserved.
//
#if os(macOS)
import Cocoa
#else
import UIKit
#endif
import AVFoundation
import AVKit
open class VersaPlayerControls: UIView {
open class VersaPlayerControls: View {
/// VersaPlayer intance being controlled
public var handler: VersaPlayerView!
@@ -27,8 +31,10 @@ open class VersaPlayerControls: UIView {
/// VersaStatefulButton instance to represent the fullscreen toggle button
@IBOutlet public weak var fullscreenButton: VersaStatefulButton? = nil
#if os(iOS)
/// VersaStatefulButton instance to represent the PIP button
@IBOutlet public weak var pipButton: VersaStatefulButton? = nil
#endif
/// VersaStatefulButton instance to represent the rewind button
@IBOutlet public weak var rewindButton: VersaStatefulButton? = nil
@@ -52,7 +58,7 @@ open class VersaPlayerControls: UIView {
@IBOutlet public weak var totalTimeLabel: VersaTimeLabel? = nil
/// UIView to be shown when buffering
@IBOutlet public weak var bufferingView: UIView? = nil
@IBOutlet public weak var bufferingView: View? = nil
private var wasPlayingBeforeRewinding: Bool = false
private var wasPlayingBeforeForwarding: Bool = false
@@ -69,12 +75,31 @@ open class VersaPlayerControls: UIView {
NotificationCenter.default.removeObserver(self, name: VersaPlayer.VPlayerNotificationName.endBuffering.notification, object: nil)
}
override open func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
#if os(macOS)
open override func touchesBegan(with event: NSEvent) {
behaviour.hide()
}
override open func didMoveToSuperview() {
override open func viewDidMoveToSuperview() {
super.viewDidMoveToSuperview()
layoutInSuperview()
}
#else
open override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
behaviour.hide()
}
open override func didMoveToSuperview() {
super.didMoveToSuperview()
layoutInSuperview()
}
#endif
public func layoutInSuperview() {
if let h = superview as? VersaPlayerControlsCoordinator {
handler = h.player
if behaviour == nil {
@@ -91,15 +116,27 @@ open class VersaPlayerControls: UIView {
open func timeDidChange(toTime time: CMTime) {
currentTimeLabel?.update(toTime: time.seconds)
totalTimeLabel?.update(toTime: handler.player.endTime().seconds)
seekbarSlider?.minimumValue = Float(handler.player.startTime().seconds)
seekbarSlider?.maximumValue = Float(handler.player.endTime().seconds)
seekbarSlider?.value = Float(time.seconds)
setSeekbarSlider(start: handler.player.startTime().seconds, end: handler.player.endTime().seconds, at: time.seconds)
if !(handler.isSeeking || handler.isRewinding || handler.isForwarding) {
behaviour.update(with: time.seconds)
}
}
public func setSeekbarSlider(start startValue: Double, end endValue: Double, at time: Double) {
#if os(macOS)
seekbarSlider?.minValue = startValue
seekbarSlider?.maxValue = endValue
seekbarSlider?.doubleValue = time
#elseif os(iOS)
seekbarSlider?.minimumValue = Float(startValue)
seekbarSlider?.maximumValue = Float(endValue)
seekbarSlider?.value = Float(time)
#else
seekbarSlider?.progress = Float(time) / Float(endValue)
#endif
}
/// Remove coordinator from player
open func removeFromPlayer() {
controlsCoordinator.removeFromSuperview()
@@ -107,19 +144,38 @@ open class VersaPlayerControls: UIView {
/// Prepare controls targets and notification listeners
open func prepare() {
layout()
stretchToEdges()
#if os(macOS)
playPauseButton?.target = self
playPauseButton?.action = #selector(togglePlayback(sender:))
fullscreenButton?.target = self
fullscreenButton?.action = #selector(toggleFullscreen(sender:))
rewindButton?.target = self
rewindButton?.action = #selector(rewindToggle(sender:))
forwardButton?.target = self
forwardButton?.action = #selector(forwardToggle(sender:))
skipForwardButton?.target = self
skipForwardButton?.action = #selector(skipForward(sender:))
skipBackwardButton?.target = self
skipBackwardButton?.action = #selector(skipBackward(sender:))
prepareSeekbar()
seekbarSlider?.target = self
seekbarSlider?.action = #selector(playheadChanged(with:))
#else
playPauseButton?.addTarget(self, action: #selector(togglePlayback), for: .touchUpInside)
fullscreenButton?.addTarget(self, action: #selector(toggleFullscreen), for: .touchUpInside)
if !AVPictureInPictureController.isPictureInPictureSupported() {
pipButton?.alpha = 0.3
pipButton?.isUserInteractionEnabled = false
}else {
pipButton?.addTarget(self, action: #selector(togglePip), for: .touchUpInside)
}
rewindButton?.addTarget(self, action: #selector(rewindToggle), for: .touchUpInside)
forwardButton?.addTarget(self, action: #selector(forwardToggle), for: .touchUpInside)
@@ -128,16 +184,46 @@ open class VersaPlayerControls: UIView {
skipBackwardButton?.addTarget(self, action: #selector(skipBackward), for: .touchUpInside)
prepareSeekbar()
#if os(iOS)
if !AVPictureInPictureController.isPictureInPictureSupported() {
pipButton?.alpha = 0.3
pipButton?.isUserInteractionEnabled = false
}else {
pipButton?.addTarget(self, action: #selector(togglePip), for: .touchUpInside)
}
seekbarSlider?.addTarget(self, action: #selector(playheadChanged(with:)), for: .valueChanged)
seekbarSlider?.addTarget(self, action: #selector(seekingEnd), for: .touchUpInside)
seekbarSlider?.addTarget(self, action: #selector(seekingEnd), for: .touchUpOutside)
seekbarSlider?.addTarget(self, action: #selector(seekingStart), for: .touchDown)
#endif
#endif
prepareNotificationListener()
}
#if os(macOS)
/// Layout in parent view
open func layout() {
open override func layout() {
super.layout()
stretchToEdges()
}
#else
open override func layoutSubviews() {
super.layoutSubviews()
stretchToEdges()
}
#endif
public func stretchToEdges() {
translatesAutoresizingMaskIntoConstraints = false
if let parent = superview {
topAnchor.constraint(equalTo: parent.topAnchor).isActive = true
@@ -173,9 +259,7 @@ open class VersaPlayerControls: UIView {
/// Prepare the seekbar values
open func prepareSeekbar() {
seekbarSlider?.value = Float(handler.player.currentTime().seconds)
seekbarSlider?.minimumValue = Float(handler.player.startTime().seconds)
seekbarSlider?.maximumValue = Float(handler.player.endTime().seconds)
setSeekbarSlider(start: handler.player.startTime().seconds, end: handler.player.endTime().seconds, at: handler.player.currentTime().seconds)
}
/// Show buffering view
@@ -189,19 +273,19 @@ open class VersaPlayerControls: UIView {
}
/// Skip forward (n) seconds in time
@IBAction open func skipForward() {
@IBAction open func skipForward(sender: Any? = nil) {
let time = handler.player.currentTime() + CMTime(seconds: skipSize, preferredTimescale: CMTimeScale(NSEC_PER_SEC))
handler.player.seek(to: time)
}
/// Skip backward (n) seconds in time
@IBAction open func skipBackward() {
@IBAction open func skipBackward(sender: Any? = nil) {
let time = handler.player.currentTime() - CMTime(seconds: skipSize, preferredTimescale: CMTimeScale(NSEC_PER_SEC))
handler.player.seek(to: time)
}
/// End seeking
@IBAction open func seekingEnd() {
@IBAction open func seekingEnd(sender: Any? = nil) {
handler.isSeeking = false
if wasPlayingBeforeSeeking {
handler.play()
@@ -209,12 +293,28 @@ open class VersaPlayerControls: UIView {
}
/// Start Seeking
@IBAction open func seekingStart() {
@IBAction open func seekingStart(sender: Any? = nil) {
wasPlayingBeforeSeeking = handler.isPlaying
handler.isSeeking = true
handler.pause()
}
#if os(macOS)
/// Playhead changed in NSSlider
///
/// - Parameters:
/// - sender: NSSlider that updated
@IBAction open func playheadChanged(with sender: NSSlider) {
let value = sender.doubleValue
let time = CMTime(seconds: value, preferredTimescale: CMTimeScale(NSEC_PER_SEC))
handler.player.seek(to: time)
behaviour.update(with: time.seconds)
}
#elseif os(iOS)
/// Playhead changed in UISlider
///
/// - Parameters:
@@ -231,14 +331,16 @@ open class VersaPlayerControls: UIView {
handler.setNativePip(enabled: !handler.isPipModeEnabled)
}
#endif
/// Toggle fullscreen mode
@IBAction open func toggleFullscreen() {
@IBAction open func toggleFullscreen(sender: Any? = nil) {
fullscreenButton?.set(active: !handler.isFullscreenModeEnabled)
handler.setFullscreen(enabled: !handler.isFullscreenModeEnabled)
}
/// Toggle playback
@IBAction open func togglePlayback() {
@IBAction open func togglePlayback(sender: Any? = nil) {
if handler.isRewinding || handler.isForwarding {
handler.player.rate = 1
playPauseButton?.set(active: true)
@@ -256,7 +358,7 @@ open class VersaPlayerControls: UIView {
}
/// Toggle rewind
@IBAction open func rewindToggle() {
@IBAction open func rewindToggle(sender: Any? = nil) {
if handler.player.currentItem?.canPlayFastReverse ?? false {
if handler.isRewinding {
rewindButton?.set(active: false)
@@ -279,7 +381,7 @@ open class VersaPlayerControls: UIView {
}
/// Forward toggle
@IBAction open func forwardToggle() {
@IBAction open func forwardToggle(sender: Any? = nil) {
if handler.player.currentItem?.canPlayFastForward ?? false {
if handler.isForwarding {
forwardButton?.set(active: false)
@@ -6,11 +6,15 @@
// Copyright © 2018 Quasar. All rights reserved.
//
#if os(macOS)
import Cocoa
#else
import UIKit
#endif
import CoreMedia
import AVFoundation
open class VersaPlayerControlsCoordinator: UIView, VersaPlayerGestureRecieverViewDelegate {
open class VersaPlayerControlsCoordinator: View, VersaPlayerGestureRecieverViewDelegate {
/// VersaPlayer instance being used
var player: VersaPlayerView!
@@ -21,8 +25,33 @@ open class VersaPlayerControlsCoordinator: UIView, VersaPlayerGestureRecieverVie
/// VersaPlayerGestureRecieverView instance being used
public var gestureReciever: VersaPlayerGestureRecieverView!
override open func didMoveToSuperview() {
#if os(macOS)
override open func viewDidMoveToSuperview() {
super.viewDidMoveToSuperview()
configureView()
}
open override func layout() {
super.layout()
stretchToEdges()
}
#else
open override func didMoveToSuperview() {
super.didMoveToSuperview()
configureView()
}
open override func layoutSubviews() {
super.layoutSubviews()
stretchToEdges()
}
#endif
public func configureView() {
if let h = superview as? VersaPlayerView {
player = h
if controls != nil {
@@ -31,14 +60,18 @@ open class VersaPlayerControlsCoordinator: UIView, VersaPlayerGestureRecieverVie
if gestureReciever == nil {
gestureReciever = VersaPlayerGestureRecieverView()
gestureReciever.delegate = self
#if os(macOS)
addSubview(gestureReciever, positioned: NSWindow.OrderingMode.below, relativeTo: nil)
#else
addSubview(gestureReciever)
sendSubview(toBack: gestureReciever)
#endif
}
layout()
stretchToEdges()
}
}
open func layout() {
public func stretchToEdges() {
translatesAutoresizingMaskIntoConstraints = false
if let parent = superview {
topAnchor.constraint(equalTo: parent.topAnchor).isActive = true
@@ -86,13 +119,17 @@ open class VersaPlayerControlsCoordinator: UIView, VersaPlayerGestureRecieverVie
/// - translation: translation of pan in CGPoint representation
/// - at: initial point recognized
open func didPan(with translation: CGPoint, initially at: CGPoint) {
let percentageTranslation: Double = Double(translation.x / gestureReciever.bounds.width)
player.player.seek(to:
CMTime.init(
seconds: player.player.endTime().seconds * percentageTranslation,
preferredTimescale: CMTimeScale(NSEC_PER_SEC)
)
)
}
#if os(tvOS)
/// Swipe was recognized
///
/// - Parameters:
/// - direction: gestureDirection
open func didSwipe(with direction: UISwipeGestureRecognizer.Direction) {
}
#endif
}
@@ -6,12 +6,33 @@
// Copyright © 2018 Quasar. All rights reserved.
//
#if os(macOS)
import Cocoa
#else
import UIKit
#endif
import CoreMedia
import AVFoundation
import AVKit
open class VersaPlayerView: UIView, AVPictureInPictureControllerDelegate {
#if os(macOS)
public typealias View = NSView
#else
public typealias View = UIView
#endif
#if os(iOS)
public typealias PIPProtocol = AVPictureInPictureControllerDelegate
#else
public protocol PIPProtocol {}
#endif
open class VersaPlayerView: View, PIPProtocol {
deinit {
player.replaceCurrentItem(with: nil)
}
/// VersaPlayer extension dictionary
public var extensions: [String: VersaPlayerExtension] = [:]
@@ -22,7 +43,7 @@ open class VersaPlayerView: UIView, AVPictureInPictureControllerDelegate {
/// VersaPlayerControls instance being used to display controls
public var controls: VersaPlayerControls? = nil
/// VPlayerRenderingView instance
/// VersaPlayerRenderingView instance
public var renderingView: VersaPlayerRenderingView!
/// VersaPlayerPlaybackDelegate instance
@@ -32,10 +53,12 @@ open class VersaPlayerView: UIView, AVPictureInPictureControllerDelegate {
public var decryptionDelegate: VersaPlayerDecryptionDelegate? = nil
/// VersaPlayer initial container
private var nonFullscreenContainer: UIView!
private var nonFullscreenContainer: View!
#if os(iOS)
/// AVPictureInPictureController instance
public var pipController: AVPictureInPictureController? = nil
#endif
/// Whether player is prepared
public var ready: Bool = false
@@ -55,6 +78,12 @@ open class VersaPlayerView: UIView, AVPictureInPictureControllerDelegate {
/// Whether PIP Mode is enabled via pipController
public var isPipModeEnabled: Bool = false
#if os(macOS)
open override var wantsLayer: Bool {
get { return true } set { }
}
#endif
/// Whether Player is Fast Forwarding
public var isForwarding: Bool {
return player.rate > 1
@@ -75,6 +104,34 @@ open class VersaPlayerView: UIView, AVPictureInPictureControllerDelegate {
prepare()
}
/// VersaPlayerControls instance to display controls in player, using VersaPlayerGestureRecieverView instance
/// to handle gestures
///
/// - Parameters:
/// - controls: VersaPlayerControls instance used to display controls
/// - gestureReciever: Optional gesture reciever view to be used to recieve gestures
public func use(controls: VersaPlayerControls, with gestureReciever: VersaPlayerGestureRecieverView? = nil) {
let coordinator = VersaPlayerControlsCoordinator()
coordinator.player = self
coordinator.controls = controls
coordinator.gestureReciever = gestureReciever
controls.controlsCoordinator = coordinator
#if os(macOS)
addSubview(coordinator, positioned: NSWindow.OrderingMode.above, relativeTo: renderingView)
#else
addSubview(coordinator)
bringSubview(toFront: coordinator)
#endif
}
/// Update controls to specified time
///
/// - Parameters:
/// - time: Time to be updated to
public func updateControls(toTime time: CMTime) {
controls?.timeDidChange(toTime: time)
}
/// Add a VersaPlayerExtension instance to the current player
///
/// - Parameters:
@@ -109,7 +166,10 @@ open class VersaPlayerView: UIView, AVPictureInPictureControllerDelegate {
/// - Parameters:
/// - view: The view to layout.
/// - into: The container view.
open func layout(view: UIView, into: UIView) {
open func layout(view: View, into: View? = nil) {
guard let into = into else {
return
}
into.addSubview(view)
view.translatesAutoresizingMaskIntoConstraints = false
view.topAnchor.constraint(equalTo: into.topAnchor).isActive = true
@@ -118,6 +178,7 @@ open class VersaPlayerView: UIView, AVPictureInPictureControllerDelegate {
view.bottomAnchor.constraint(equalTo: into.bottomAnchor).isActive = true
}
#if os(iOS)
/// Enables or disables PIP when available (when device is supported)
///
/// - Parameters:
@@ -129,6 +190,7 @@ open class VersaPlayerView: UIView, AVPictureInPictureControllerDelegate {
pipController?.stopPictureInPicture()
}
}
#endif
/// Enables or disables fullscreen
///
@@ -139,11 +201,19 @@ open class VersaPlayerView: UIView, AVPictureInPictureControllerDelegate {
return
}
if enabled {
#if os(macOS)
if let window = NSApplication.shared.keyWindow {
nonFullscreenContainer = superview
removeFromSuperview()
layout(view: self, into: window.contentView)
}
#else
if let window = UIApplication.shared.keyWindow {
nonFullscreenContainer = superview
removeFromSuperview()
layout(view: self, into: window)
}
#endif
}else {
removeFromSuperview()
layout(view: self, into: nonFullscreenContainer)
@@ -167,34 +237,8 @@ open class VersaPlayerView: UIView, AVPictureInPictureControllerDelegate {
}
}
/// VersaPlayerControls instance to display controls in player, using VersaPlayerGestureRecieverView instance
/// to handle gestures
///
/// - Parameters:
/// - controls: VersaPlayerControls instance used to display controls
/// - gestureReciever: Optional gesture reciever view to be used to recieve gestures
public func use(controls: VersaPlayerControls, with gestureReciever: VersaPlayerGestureRecieverView? = nil) {
let coordinator = VersaPlayerControlsCoordinator()
coordinator.player = self
coordinator.controls = controls
coordinator.gestureReciever = gestureReciever
controls.controlsCoordinator = coordinator
addSubview(coordinator)
bringSubview(toFront: controls)
self.controls = controls
}
/// Update controls to specified time
///
/// - Parameters:
/// - time: Time to be updated to
public func updateControls(toTime time: CMTime) {
controls?.timeDidChange(toTime: time)
}
/// Play
@IBAction open func play() {
@IBAction open func play(sender: Any? = nil) {
if playbackDelegate?.playbackShouldBegin(player: player) ?? true {
player.play()
isPlaying = true
@@ -202,13 +246,13 @@ open class VersaPlayerView: UIView, AVPictureInPictureControllerDelegate {
}
/// Pause
@IBAction open func pause() {
@IBAction open func pause(sender: Any? = nil) {
player.pause()
isPlaying = false
}
/// Toggle Playback
@IBAction open func togglePlayback() {
@IBAction open func togglePlayback(sender: Any? = nil) {
if isPlaying {
pause()
}else {
@@ -216,6 +260,7 @@ open class VersaPlayerView: UIView, AVPictureInPictureControllerDelegate {
}
}
#if os(iOS)
open func pictureInPictureControllerDidStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) {
//hide fallback
}
@@ -233,5 +278,6 @@ open class VersaPlayerView: UIView, AVPictureInPictureControllerDelegate {
controls?.controlsCoordinator.isHidden = true
isPipModeEnabled = true
}
#endif
}
@@ -1,20 +0,0 @@
//
// VersaSeekbarSlider.swift
// VersaPlayer Demo
//
// Created by Jose Quintero on 10/11/18.
// Copyright © 2018 Quasar. All rights reserved.
//
import UIKit
@IBDesignable
open class VersaSeekbarSlider: UISlider {
@IBInspectable public var thumbImage: UIImage? = nil {
didSet {
setThumbImage(thumbImage, for: .normal)
}
}
}
@@ -1,30 +0,0 @@
//
// VersaRewindButton.swift
// VersaPlayer Demo
//
// Created by Jose Quintero on 10/11/18.
// Copyright © 2018 Quasar. All rights reserved.
//
import UIKit
@IBDesignable
open class VersaStatefulButton: UIButton {
@IBInspectable public var activeImage: UIImage? = nil
@IBInspectable public var inactiveImage: UIImage? = nil {
didSet {
setImage(inactiveImage, for: .normal)
}
}
open func set(active: Bool) {
if active {
setImage(activeImage, for: .normal)
}else {
setImage(inactiveImage, for: .normal)
}
}
}
@@ -1,92 +0,0 @@
//
// VersaPlayerGestureRecieverView.swift
// VersaPlayerView Demo
//
// Created by Jose Quintero on 10/11/18.
// Copyright © 2018 Quasar. All rights reserved.
//
import UIKit
open class VersaPlayerGestureRecieverView: UIView {
/// VersaPlayerGestureRecieverViewDelegate instance
public var delegate: VersaPlayerGestureRecieverViewDelegate? = nil
/// Single tap UITapGestureRecognizer
public var tapGesture: UITapGestureRecognizer? = nil
/// Double tap UITapGestureRecognizer
public var doubleTapGesture: UITapGestureRecognizer? = nil
/// UIPanGestureRecognizer
public var panGesture: UIPanGestureRecognizer? = nil
/// UIPinchGestureRecognizer
public var pinchGesture: UIPinchGestureRecognizer? = nil
/// Whether or not reciever view is ready
public var ready: Bool = false
/// Pan gesture initial point
public var panGestureInitialPoint: CGPoint = CGPoint.zero
override open func didMoveToSuperview() {
super.didMoveToSuperview()
translatesAutoresizingMaskIntoConstraints = false
if let parent = superview {
topAnchor.constraint(equalTo: parent.topAnchor).isActive = true
leftAnchor.constraint(equalTo: parent.leftAnchor).isActive = true
rightAnchor.constraint(equalTo: parent.rightAnchor).isActive = true
bottomAnchor.constraint(equalTo: parent.bottomAnchor).isActive = true
}
if !ready {
prepare()
}
}
/// Prepare the view gesture recognizers
open func prepare() {
ready = true
isUserInteractionEnabled = true
tapGesture = UITapGestureRecognizer(target: self, action: #selector(tapHandler(with:)))
tapGesture?.numberOfTapsRequired = 1
doubleTapGesture = UITapGestureRecognizer(target: self, action: #selector(doubleTapHandler(with:)))
doubleTapGesture?.numberOfTapsRequired = 2
tapGesture?.require(toFail: doubleTapGesture!)
pinchGesture = UIPinchGestureRecognizer(target: self, action: #selector(pinchHandler(with:)))
panGesture = UIPanGestureRecognizer(target: self, action: #selector(panHandler(with:)))
panGesture?.minimumNumberOfTouches = 1
addGestureRecognizer(tapGesture!)
addGestureRecognizer(doubleTapGesture!)
addGestureRecognizer(panGesture!)
addGestureRecognizer(pinchGesture!)
}
@objc open func tapHandler(with sender: UITapGestureRecognizer) {
delegate?.didTap(at: sender.location(in: self))
}
@objc open func doubleTapHandler(with sender: UITapGestureRecognizer) {
delegate?.didDoubleTap(at: sender.location(in: self))
}
@objc open func pinchHandler(with sender: UIPinchGestureRecognizer) {
if sender.state == .ended {
delegate?.didPinch(with: sender.scale)
}
}
@objc open func panHandler(with sender: UIPanGestureRecognizer) {
if sender.state == .began {
panGestureInitialPoint = sender.location(in: self)
}
delegate?.didPan(with: sender.translation(in: self), initially: panGestureInitialPoint)
}
}
@@ -283,7 +283,7 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-VersaPlayerAdsExtension_Example/Pods-VersaPlayerAdsExtension_Example-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-VersaPlayerAdsExtension_Example/Pods-VersaPlayerAdsExtension_Example-frameworks.sh",
"${PODS_ROOT}/GoogleAds-IMA-iOS-SDK/GoogleInteractiveMediaAds.framework",
"${BUILT_PRODUCTS_DIR}/VersaPlayer/VersaPlayer.framework",
"${BUILT_PRODUCTS_DIR}/VersaPlayerAdsExtension/VersaPlayerAdsExtension.framework",
@@ -296,7 +296,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-VersaPlayerAdsExtension_Example/Pods-VersaPlayerAdsExtension_Example-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-VersaPlayerAdsExtension_Example/Pods-VersaPlayerAdsExtension_Example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
BA24E07B0506C095E3F06889 /* [CP] Check Pods Manifest.lock */ = {
@@ -323,7 +323,7 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-VersaPlayerAdsExtension_Tests/Pods-VersaPlayerAdsExtension_Tests-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-VersaPlayerAdsExtension_Tests/Pods-VersaPlayerAdsExtension_Tests-frameworks.sh",
"${PODS_ROOT}/GoogleAds-IMA-iOS-SDK/GoogleInteractiveMediaAds.framework",
"${BUILT_PRODUCTS_DIR}/VersaPlayer/VersaPlayer.framework",
"${BUILT_PRODUCTS_DIR}/FBSnapshotTestCase/FBSnapshotTestCase.framework",
@@ -336,7 +336,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-VersaPlayerAdsExtension_Tests/Pods-VersaPlayerAdsExtension_Tests-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-VersaPlayerAdsExtension_Tests/Pods-VersaPlayerAdsExtension_Tests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
+1 -1
View File
@@ -8,7 +8,7 @@
Pod::Spec.new do |s|
s.name = 'VersaPlayerAdsExtension'
s.version = '0.5.1'
s.version = '1.0.1'
s.summary = 'VersaPlayer Extension to enable video ads.'
s.description = 'VersaPlayer Extension to enable video ads functionality.'
s.homepage = 'https://github.com/josejuanqm/VersaPlayerAdsExtension'