diff --git a/AEPMedia/Sources/MediaServiceable.swift b/AEPMedia/Sources/MediaProcessor.swift similarity index 81% rename from AEPMedia/Sources/MediaServiceable.swift rename to AEPMedia/Sources/MediaProcessor.swift index 6d58a80..3c5c3f9 100644 --- a/AEPMedia/Sources/MediaServiceable.swift +++ b/AEPMedia/Sources/MediaProcessor.swift @@ -11,11 +11,7 @@ import Foundation -protocol MediaServiceable { +protocol MediaProcessor { - func createSession() -> MediaSession - - func processSessions() - - func abortAllSessions() + func createSession(state: MediaState) -> MediaSession } diff --git a/AEPMedia/Sources/MediaSession.swift b/AEPMedia/Sources/MediaSession.swift index 22febfa..b68131f 100644 --- a/AEPMedia/Sources/MediaSession.swift +++ b/AEPMedia/Sources/MediaSession.swift @@ -15,7 +15,7 @@ protocol MediaSession { func processHit(hit: MediaHit) - func endSession() + func end() func abort() } diff --git a/AEPMedia/Sources/MediaState.swift b/AEPMedia/Sources/MediaState.swift new file mode 100644 index 0000000..4ed1243 --- /dev/null +++ b/AEPMedia/Sources/MediaState.swift @@ -0,0 +1,16 @@ +/* + Copyright 2021 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + +import Foundation + +class MediaState { + //TODO: implementation of this class. +} diff --git a/AEPMedia/Sources/MediaHit.swift b/AEPMedia/Sources/mediacollection/MediaHit.swift similarity index 56% rename from AEPMedia/Sources/MediaHit.swift rename to AEPMedia/Sources/mediacollection/MediaHit.swift index 96eeb68..ec34df2 100644 --- a/AEPMedia/Sources/MediaHit.swift +++ b/AEPMedia/Sources/mediacollection/MediaHit.swift @@ -4,27 +4,14 @@ you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under - the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES REPRESENTATIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import Foundation -protocol MediaHit { - - init(eventType: String, params: [String: Any], metaData: [String:String], qoeData: [String:Any], playHead: Double, timeInterval: TimeInterval) - - func getEventType() -> [String:Any] - - func getParams() -> [String:String] - - func getCustomMetaData() -> [String:String] - - func getQoeData() -> [String:Any] - - func getPlayHead() -> Double - - func getTimeStamp() -> TimeInterval +import Foundation +class MediaHit { + //TODO: Implement class MediaHit. } diff --git a/build/AEPMedia.xcodeproj/project.pbxproj b/build/AEPMedia.xcodeproj/project.pbxproj index c6e78cd..dcd34a5 100644 --- a/build/AEPMedia.xcodeproj/project.pbxproj +++ b/build/AEPMedia.xcodeproj/project.pbxproj @@ -11,10 +11,11 @@ 2E20D4A725CA154C00B5CCB8 /* MediaRuleEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E20D4A525CA154C00B5CCB8 /* MediaRuleEngine.swift */; }; 2E20D4AB25CA544000B5CCB8 /* MediaRuleEngineTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E20D4AA25CA544000B5CCB8 /* MediaRuleEngineTests.swift */; }; 2EFF1B5B25BF57FC00375965 /* AEPMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2EFF1B5125BF57FC00375965 /* AEPMedia.framework */; }; - 3D9D530B25D4AFB000F33EB7 /* MediaHit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9D530A25D4AFB000F33EB7 /* MediaHit.swift */; }; + 3D2C836325E5CADC0064E0D4 /* MediaState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D2C836225E5CADC0064E0D4 /* MediaState.swift */; }; + 3D2C836A25E5CFDF0064E0D4 /* MediaHit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D2C836925E5CFDF0064E0D4 /* MediaHit.swift */; }; 3D9D531725D5E73100F33EB7 /* MediaSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9D531625D5E73100F33EB7 /* MediaSession.swift */; }; 3D9D531B25D5E75B00F33EB7 /* MediaEventTracking.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9D531A25D5E75B00F33EB7 /* MediaEventTracking.swift */; }; - 3D9D531F25D5ED3E00F33EB7 /* MediaServiceable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9D531E25D5ED3E00F33EB7 /* MediaServiceable.swift */; }; + 3D9D531F25D5ED3E00F33EB7 /* MediaProcessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9D531E25D5ED3E00F33EB7 /* MediaProcessor.swift */; }; 7104D52FCE7CD4FBED7235C4 /* Pods_AEPMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 13F8B2DE1682787F0FD4D771 /* Pods_AEPMedia.framework */; }; AC36EC3F25C9F11E00A37345 /* MediaTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC36EC3525C9F11E00A37345 /* MediaTracker.swift */; }; AC36EC4025C9F11E00A37345 /* Media.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC36EC3625C9F11E00A37345 /* Media.swift */; }; @@ -44,10 +45,11 @@ 2E5A32F865BD4CB1D4FACE3F /* Pods-AEPMedia.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AEPMedia.release.xcconfig"; path = "Target Support Files/Pods-AEPMedia/Pods-AEPMedia.release.xcconfig"; sourceTree = ""; }; 2EFF1B5125BF57FC00375965 /* AEPMedia.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AEPMedia.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 2EFF1B5A25BF57FC00375965 /* AEPMediaTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AEPMediaTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 3D9D530A25D4AFB000F33EB7 /* MediaHit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaHit.swift; sourceTree = ""; }; + 3D2C836225E5CADC0064E0D4 /* MediaState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaState.swift; sourceTree = ""; }; + 3D2C836925E5CFDF0064E0D4 /* MediaHit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaHit.swift; sourceTree = ""; }; 3D9D531625D5E73100F33EB7 /* MediaSession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaSession.swift; sourceTree = ""; }; 3D9D531A25D5E75B00F33EB7 /* MediaEventTracking.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaEventTracking.swift; sourceTree = ""; }; - 3D9D531E25D5ED3E00F33EB7 /* MediaServiceable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaServiceable.swift; sourceTree = ""; }; + 3D9D531E25D5ED3E00F33EB7 /* MediaProcessor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaProcessor.swift; sourceTree = ""; }; 81B6B11A87DE4E2228FA46FB /* Pods_AEPMedia_AEPMediaTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AEPMedia_AEPMediaTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A7EED2E95CAF988912D5E599 /* Pods-AEPMedia.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AEPMedia.debug.xcconfig"; path = "Target Support Files/Pods-AEPMedia/Pods-AEPMedia.debug.xcconfig"; sourceTree = ""; }; AC36EC2E25C9F11E00A37345 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -125,6 +127,14 @@ name = Products; sourceTree = ""; }; + 3D2C836625E5CFAA0064E0D4 /* mediacollection */ = { + isa = PBXGroup; + children = ( + 3D2C836925E5CFDF0064E0D4 /* MediaHit.swift */, + ); + path = mediacollection; + sourceTree = ""; + }; 9598EB9A2980A6BD84A67D20 /* Pods */ = { isa = PBXGroup; children = ( @@ -177,6 +187,7 @@ AC36EC3425C9F11E00A37345 /* Sources */ = { isa = PBXGroup; children = ( + 3D2C836625E5CFAA0064E0D4 /* mediacollection */, 2E20D4A425CA154C00B5CCB8 /* MediaRule.swift */, 2E20D4A525CA154C00B5CCB8 /* MediaRuleEngine.swift */, AC36EC3525C9F11E00A37345 /* MediaTracker.swift */, @@ -185,10 +196,10 @@ AC36EC3825C9F11E00A37345 /* Media+PublicAPI.swift */, AC36EC3925C9F11E00A37345 /* MediaConstants.swift */, AC36EC3A25C9F11E00A37345 /* Info.plist */, - 3D9D530A25D4AFB000F33EB7 /* MediaHit.swift */, 3D9D531625D5E73100F33EB7 /* MediaSession.swift */, 3D9D531A25D5E75B00F33EB7 /* MediaEventTracking.swift */, - 3D9D531E25D5ED3E00F33EB7 /* MediaServiceable.swift */, + 3D9D531E25D5ED3E00F33EB7 /* MediaProcessor.swift */, + 3D2C836225E5CADC0064E0D4 /* MediaState.swift */, ); path = Sources; sourceTree = ""; @@ -370,15 +381,16 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 3D2C836325E5CADC0064E0D4 /* MediaState.swift in Sources */, AC36EC4325C9F11E00A37345 /* MediaConstants.swift in Sources */, AC36EC4025C9F11E00A37345 /* Media.swift in Sources */, 2E20D4A725CA154C00B5CCB8 /* MediaRuleEngine.swift in Sources */, + 3D2C836A25E5CFDF0064E0D4 /* MediaHit.swift in Sources */, AC36EC3F25C9F11E00A37345 /* MediaTracker.swift in Sources */, 3D9D531B25D5E75B00F33EB7 /* MediaEventTracking.swift in Sources */, 2E20D4A625CA154C00B5CCB8 /* MediaRule.swift in Sources */, AC36EC4225C9F11E00A37345 /* Media+PublicAPI.swift in Sources */, - 3D9D530B25D4AFB000F33EB7 /* MediaHit.swift in Sources */, - 3D9D531F25D5ED3E00F33EB7 /* MediaServiceable.swift in Sources */, + 3D9D531F25D5ED3E00F33EB7 /* MediaProcessor.swift in Sources */, 3D9D531725D5E73100F33EB7 /* MediaSession.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0;