我能够在我的应用程序中使用内置摄像头录制视频,但我想在下一个屏幕中显示视频缩略图以及其他一些字段,如日期,时间和视频位置。我很惊讶在一个单独的页面上显示视频的缩略图。我无法在下一个屏幕中获取视频文件。有人可以帮忙吗?
视频课 公共类视频扩展AppCompatActivity { private static final int VIDEO_REQUEST_CODE = 100;
func ConnectionHandler()
{
let dg = DispatchGroup()
switch self.RequestType
{
case aRequest:
//if I make a single call here, works fine
case bRequest:
//if I make a single call here, works fine
case abRequest:
//when making requests for both type a and b, can’t get it to work
dg.enter()
loader.perform(request: self.userDataRequest)
{ response in
do
{
let json = try response.responseJSON()
self.structWrapper.aArray = self.loadAArray(dict: json)
}
catch let error {
self.didCancelOrFail(error)
}
dg.leave()
}
self.dexRequestType = DexRequestTypesEnum.glucoseValues
dg.enter()
loader.perform(request: self.userDataRequest)
{ response in
do
{
let json = try response.responseJSON()
self.structWrapper.bArray = self.loadBArray(dict: json) }
catch let error {
self.didCancelOrFail(error)
}
dg.leave()
}
group.notify(queue: .main)
{
//will print, but requests are not complete, arrays are empty, even though breakpoints hit in loading them.
for x in self.structWrapper.aArray
{
print(x.displayTime + ":" + x.units)
}
for y in self.structWrapper.bArray
{
print(y.displayTime + ":" + String(y.someNumber)
}
print(“tasks complete”)
}
}
}
}