@takeoffmedia/react-native-penthera 0.2.39 → 0.2.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,8 +14,11 @@ class AssetQueueObserver(mOfflineVideo : OfflineVideoEngine) : Observers.IQueueO
14
14
  private var mOfflineVideo : OfflineVideoEngine = mOfflineVideo
15
15
 
16
16
  override fun engineStartedDownloadingAsset(aAsset: IIdentifier) {
17
+ val updateAsset = aAsset as IAsset
18
+ val assetId = updateAsset.assetId
17
19
  lastProgress = -1
18
20
  updateItem(aAsset, true)
21
+ EventEmitter.sharedInstance.dispatch("penthera", PentheraEvent.DID_START_DOWNLOADING, assetId, "")
19
22
  }
20
23
 
21
24
  override fun enginePerformedProgressUpdateDuringDownload(aAsset: IIdentifier) {
@@ -31,9 +34,14 @@ class AssetQueueObserver(mOfflineVideo : OfflineVideoEngine) : Observers.IQueueO
31
34
  }
32
35
 
33
36
  override fun engineEncounteredErrorDownloadingAsset(aAsset: IIdentifier) {
37
+ Log.e("MiModulo","<<<<<<<<<<engineEncounteredErrorDownloadingAsset>>>>>>>>>>>>")
34
38
  // The base implementation does nothing. See class documentation.
35
39
  }
36
40
 
41
+ override fun engineEncounteredErrorParsingAsset(mAssetId: String) {
42
+ Log.e("MiModulo","<<<<<<<<<<engineEncounteredErrorParsingAsset>>>>>>>>>>>>")
43
+ }
44
+
37
45
  override fun engineUpdatedQueue() {
38
46
  // This indicates a change to the download queue - meaning either we added or removed something
39
47
  Log.e("MiModulo","<<<<<<<<<<engineUpdatedQueue>>>>>>>>>>>>")
@@ -55,11 +63,6 @@ class AssetQueueObserver(mOfflineVideo : OfflineVideoEngine) : Observers.IQueueO
55
63
  }
56
64
  }
57
65
 
58
- override fun engineEncounteredErrorParsingAsset(mAssetId: String) {
59
- Log.e("MiModulo","<<<<<<<<<<engineEncounteredErrorParsingAsset>>>>>>>>>>>>")
60
- }
61
-
62
-
63
66
  private fun updateItem(aFile: IIdentifier, forceUpdate: Boolean) {
64
67
  Log.e("MiModulo","<<<<<<<<<<updateItem>>>>>>>>>>>>")
65
68
 
@@ -69,7 +72,7 @@ class AssetQueueObserver(mOfflineVideo : OfflineVideoEngine) : Observers.IQueueO
69
72
  // Progress is for catalog item
70
73
  if (assetId.isNotEmpty() && mOfflineVideo.assetId == assetId) {
71
74
  //update our asset status
72
- // mActivity.runOnUiThread{ updateItemStatus(updateAsset, forceUpdate) }
75
+ //mActivity.runOnUiThread{ updateItemStatus(updateAsset, forceUpdate) }
73
76
  //mOfflineVideo { updateItemStatus(updateAsset, forceUpdate) }
74
77
  updateItemStatus(updateAsset, forceUpdate)
75
78
  }
@@ -88,7 +91,8 @@ class AssetQueueObserver(mOfflineVideo : OfflineVideoEngine) : Observers.IQueueO
88
91
  if (forceUpdate || progress != lastProgress) {
89
92
  val assetStatus : String
90
93
  val value: String
91
- when (asset.downloadStatus) {
94
+ val status = asset.downloadStatus
95
+ when (status) {
92
96
 
93
97
  Common.AssetStatus.DOWNLOADING -> {
94
98
  assetStatus = "Downloading"
@@ -107,7 +111,7 @@ class AssetQueueObserver(mOfflineVideo : OfflineVideoEngine) : Observers.IQueueO
107
111
 
108
112
  Common.AssetStatus.DOWNLOAD_DENIED_ASSET -> {
109
113
  assetStatus = "Queued"
110
- value = "DENIED : MAD"
114
+ value = "The asset has already been downloaded as many times as permitted. To download this asset again, administrative action is required."
111
115
  }
112
116
 
113
117
  Common.AssetStatus.DOWNLOAD_DENIED_ACCOUNT -> {
@@ -122,7 +126,7 @@ class AssetQueueObserver(mOfflineVideo : OfflineVideoEngine) : Observers.IQueueO
122
126
 
123
127
  Common.AssetStatus.DOWNLOAD_DENIED_MAX_DEVICE_DOWNLOADS -> {
124
128
  assetStatus = "Queued"
125
- value = "DENIED :MPD"
129
+ value = "DENIED :MPD Test maximo copias"
126
130
  }
127
131
 
128
132
  Common.AssetStatus.DOWNLOAD_BLOCKED_AWAITING_PERMISSION -> {
@@ -132,7 +136,7 @@ class AssetQueueObserver(mOfflineVideo : OfflineVideoEngine) : Observers.IQueueO
132
136
 
133
137
  Common.AssetStatus.DOWNLOAD_DENIED_COPIES -> {
134
138
  assetStatus = "Queued"
135
- value = "DENIED : COPIES"
139
+ value = "There are already as many downloaded copies of this asset as permitted on this account. To continue downloading, the user must delete a copy of this asset from one of their devices."
136
140
  }
137
141
 
138
142
  else -> {
@@ -140,7 +144,9 @@ class AssetQueueObserver(mOfflineVideo : OfflineVideoEngine) : Observers.IQueueO
140
144
  value = "pending"
141
145
  }
142
146
  }
143
-
147
+ if(assetStatus !== "Downloading"){
148
+ EventEmitter.sharedInstance.dispatch("penthera", PentheraEvent.ERROR_DOWNLOAD, it.assetId, value)
149
+ }
144
150
  }
145
151
  }
146
152
  }
@@ -1,15 +1,10 @@
1
1
  package com.takeoffmediareactnativepenthera.virtuoso
2
2
 
3
- import EventEmitter
4
- import PentheraEvent
5
- import com.bitmovin.player.util.ParcelUtil
6
3
  import android.annotation.SuppressLint
7
4
  import android.app.Activity
8
5
  import android.content.Context
9
6
  import android.util.Log
10
7
  import android.widget.Toast
11
- import com.bitmovin.player.PlayerView
12
- import com.bitmovin.player.api.Player
13
8
  import com.bitmovin.player.reactnative.PlayerModule
14
9
 
15
10
  import com.facebook.react.bridge.ReactApplicationContext
@@ -27,19 +22,11 @@ import com.penthera.virtuososdk.client.bitmovin.BitmovinSourceManager
27
22
  import com.penthera.virtuososdk.client.builders.MPDAssetBuilder
28
23
  import com.penthera.virtuososdk.interfaces.toolkit.VirtuosoSegmentedFile
29
24
  import com.takeoffmediareactnativepenthera.AssetQueueObserver
30
- import com.takeoffmediareactnativepenthera.YourPlayerActivity
31
- import com.takeoffmediareactnativepenthera.virtuoso.data.Item
32
25
  import java.net.URL
33
- import java.util.UUID
34
- import com.bitmovin.player.reactnative.SourceModule
35
- import com.bitmovin.player.reactnative.converter.JsonConverter
36
26
  import com.facebook.react.bridge.Arguments
37
- import com.facebook.react.bridge.ReadableMap
38
27
  import com.facebook.react.uimanager.UIManagerModule
39
28
  import com.facebook.react.bridge.Promise
40
29
  import com.facebook.react.bridge.ReadableArray
41
- import com.facebook.react.bridge.WritableMap
42
- import com.takeoffmediareactnativepenthera.virtuoso.data.Data
43
30
  import org.json.JSONObject
44
31
 
45
32
  class OfflineVideoEngine(private val context: ReactApplicationContext) {
@@ -114,7 +101,7 @@ class OfflineVideoEngine(private val context: ReactApplicationContext) {
114
101
  val item = data["item"] as JSONObject
115
102
  val url = data["url"].toString()
116
103
  assetId = item["id"].toString()
117
- val metadata = item["data"].toString()
104
+ val metadata = item.toString()
118
105
  val params = MPDAssetBuilder().apply {
119
106
  assetId(assetId)
120
107
  manifestUrl(URL(url))
@@ -145,7 +132,10 @@ class OfflineVideoEngine(private val context: ReactApplicationContext) {
145
132
  if (columnIndex >= 0) {
146
133
  val value = cursor.getString(columnIndex)
147
134
  if (columnName == "description") {
148
- dataMap["data"] = JSONObject(value)
135
+ val jsonObject = Gson().fromJson(value, Map::class.java)
136
+ dataMap["data"] = jsonObject["data"] as Any
137
+ dataMap["title"] = jsonObject["title"] as Any
138
+ dataMap["thumbnails"] = jsonObject["thumbnails"] as Any
149
139
  }
150
140
  else if (value != null) {
151
141
  dataMap[columnName] = value
@@ -153,7 +143,12 @@ class OfflineVideoEngine(private val context: ReactApplicationContext) {
153
143
  if (columnName == "assetId") {
154
144
  dataMap["id"] = value
155
145
  }
156
-
146
+ if (columnName == "durationSeconds") {
147
+ dataMap["duration"] = value
148
+ }
149
+ if (columnName == "expectedSize") {
150
+ dataMap["estimatedSize"] = value
151
+ }
157
152
  }
158
153
  }
159
154
  dataMap["isCompleted"] = dataMap["currentSize"] == dataMap["expectedSize"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takeoffmedia/react-native-penthera",
3
- "version": "0.2.39",
3
+ "version": "0.2.40",
4
4
  "description": "test",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Workspace
3
- version = "1.0">
4
- <FileRef
5
- location = "self:">
6
- </FileRef>
7
- </Workspace>
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>IDEDidComputeMac32BitWarning</key>
6
- <true/>
7
- </dict>
8
- </plist>
@@ -1,104 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Bucket
3
- uuid = "3AE98629-7421-4561-B12C-C06B8B6A3023"
4
- type = "1"
5
- version = "2.0">
6
- <Breakpoints>
7
- <BreakpointProxy
8
- BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
9
- <BreakpointContent
10
- uuid = "A5D166B0-3C57-4F4D-A845-BDB81498DA0F"
11
- shouldBeEnabled = "No"
12
- ignoreCount = "0"
13
- continueAfterRunningActions = "No"
14
- filePath = "Penthera.swift"
15
- startingColumnNumber = "9223372036854775807"
16
- endingColumnNumber = "9223372036854775807"
17
- startingLineNumber = "18"
18
- endingLineNumber = "18"
19
- landmarkName = "Penthera"
20
- landmarkType = "3">
21
- </BreakpointContent>
22
- </BreakpointProxy>
23
- <BreakpointProxy
24
- BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
25
- <BreakpointContent
26
- uuid = "5D7AE47B-D5FC-4468-A75B-C414F3F8A58C"
27
- shouldBeEnabled = "No"
28
- ignoreCount = "0"
29
- continueAfterRunningActions = "No"
30
- filePath = "Penthera.swift"
31
- startingColumnNumber = "9223372036854775807"
32
- endingColumnNumber = "9223372036854775807"
33
- startingLineNumber = "25"
34
- endingLineNumber = "25"
35
- landmarkName = "updateStatusInfo()"
36
- landmarkType = "7">
37
- </BreakpointContent>
38
- </BreakpointProxy>
39
- <BreakpointProxy
40
- BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
41
- <BreakpointContent
42
- uuid = "E3C50B30-46CF-4D56-8C49-C257C70E0ACC"
43
- shouldBeEnabled = "No"
44
- ignoreCount = "0"
45
- continueAfterRunningActions = "No"
46
- filePath = "Penthera.swift"
47
- startingColumnNumber = "9223372036854775807"
48
- endingColumnNumber = "9223372036854775807"
49
- startingLineNumber = "26"
50
- endingLineNumber = "26"
51
- landmarkName = "updateStatusInfo()"
52
- landmarkType = "7">
53
- </BreakpointContent>
54
- </BreakpointProxy>
55
- <BreakpointProxy
56
- BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
57
- <BreakpointContent
58
- uuid = "75EF43BF-56FF-4727-B372-E1A0EBC02C61"
59
- shouldBeEnabled = "Yes"
60
- ignoreCount = "0"
61
- continueAfterRunningActions = "No"
62
- filePath = "Penthera.swift"
63
- startingColumnNumber = "9223372036854775807"
64
- endingColumnNumber = "9223372036854775807"
65
- startingLineNumber = "101"
66
- endingLineNumber = "101"
67
- landmarkName = "initializeSdk(user:backplaneUrl:publicKey:privateKey:resolve:reject:)"
68
- landmarkType = "7">
69
- </BreakpointContent>
70
- </BreakpointProxy>
71
- <BreakpointProxy
72
- BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
73
- <BreakpointContent
74
- uuid = "EF36B51B-4FC2-4989-A791-180E3212EFE3"
75
- shouldBeEnabled = "Yes"
76
- ignoreCount = "0"
77
- continueAfterRunningActions = "No"
78
- filePath = "Penthera.swift"
79
- startingColumnNumber = "9223372036854775807"
80
- endingColumnNumber = "9223372036854775807"
81
- startingLineNumber = "149"
82
- endingLineNumber = "149"
83
- landmarkName = "getDownloadedAsset(assetID:)"
84
- landmarkType = "7">
85
- </BreakpointContent>
86
- </BreakpointProxy>
87
- <BreakpointProxy
88
- BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
89
- <BreakpointContent
90
- uuid = "C467C00E-2428-4D24-843A-E7CDF28CB553"
91
- shouldBeEnabled = "Yes"
92
- ignoreCount = "0"
93
- continueAfterRunningActions = "No"
94
- filePath = "Penthera.swift"
95
- startingColumnNumber = "9223372036854775807"
96
- endingColumnNumber = "9223372036854775807"
97
- startingLineNumber = "148"
98
- endingLineNumber = "148"
99
- landmarkName = "getDownloadedAsset(assetID:)"
100
- landmarkType = "7">
101
- </BreakpointContent>
102
- </BreakpointProxy>
103
- </Breakpoints>
104
- </Bucket>
@@ -1,14 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>SchemeUserState</key>
6
- <dict>
7
- <key>Penthera.xcscheme_^#shared#^_</key>
8
- <dict>
9
- <key>orderHint</key>
10
- <integer>0</integer>
11
- </dict>
12
- </dict>
13
- </dict>
14
- </plist>