Integrate photo, audio, and video content into your apps.

Posts under Media tag

200 Posts

Post

Replies

Boosts

Views

Activity

Quicktime Interactivity?
Is it still possible to tutor a QuickTime movie with hyperlinks? I'm building a website and I know at one point you could author a QuickTime movie that supported links inside the video - either to other timestamps in the video or to other web pages. I don't want to use a custom player, I'd prefer to use the system level. I've seen a really amazing example of this on the mobile version of the memory alpha (Star Trek nerds!) website. There is a movie that plays at the top of pages that is fully interactive. Is that still supported? Is it possible to author that way? I'm not making anything insanely complicate, I just thought it would be a nice way to build a website with tools I'm more comfortable working in.
1
0
1.6k
Aug ’23
Progressively supply media data
I'm trying to use the resourceLoader of an AVAsset to progressively supply media data. Unable to because the delegate asks for the full content requestsAllDataToEndOfResource = true. class ResourceLoader: NSObject, AVAssetResourceLoaderDelegate { func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForLoadingOfRequestedResource loadingRequest: AVAssetResourceLoadingRequest) -> Bool { if let ci = loadingRequest.contentInformationRequest { ci.contentType = // public.mpeg-4 ci.contentLength = // GBs ci.isEntireLengthAvailableOnDemand = false ci.isByteRangeAccessSupported = true } if let dr = loadingRequest.dataRequest { if dr.requestedLength > 200_000_000 { // memory pressure // dr.requestsAllDataToEndOfResource is true } } return true } } Also tried using a fragmented MP4 created using AVAssetWriter. But didn't work. Please let me know if it's possible for the AVAssetResourceLoader to not ask for the full content?
1
0
1.1k
Aug ’23
Swift: Save image with file name using PHPhotoLibrary and PHAssetCreationRequest
I  am trying to save an image to the user's photo library using PHPhotoLibrary and set the image file name at the time of saving suing the code below. This is working the first time, but if I then try to save the same image again with a different file name, it saves with the same file name as before. Is there something I need to add to let the system know to save a new version of the image with a new file name? Thank you PHPhotoLibrary.shared().performChanges ({ let assetType:PHAssetResourceType = .photo let request:PHAssetCreationRequest = .forAsset() let createOptions:PHAssetResourceCreationOptions = PHAssetResourceCreationOptions() createOptions.originalFilename = "\(fileName)" request.addResource(with: assetType, data: image.jpegData(compressionQuality: 1)!, options: createOptions) }, completionHandler: { success, error in if success == true && error == nil { print("Success saving image") } else { print("Error saving image: \(error!.localizedDescription)") } })
3
0
2.9k
Aug ’23
Video Streaming Protocols Supported
I am aware that HLS is required for most video streaming use cases (watching a movie, TV show, or YouTube video). This is a requirement for all apps. However, I am confused as to whether this would also apply to video chat/video conferencing apps. It would be inefficient to upload compressed video using rtmp/rtp, decompress it, and create HLS segments. Low latency requirements only make this worse. So, is it permissible to use other protocols for video conferencing use cases? Thanks
1
0
870
Jul ’23
replay broken on ios 16 safari with application/x-mpegURL (HLS)
Hi, Replay doesn't work on HLS videos (.m3u8) on ios 16 safari when you get to the end of a video. It works on .mp4s, .movs, etc. I have written a github issue on the videojs repo here: https://github.com/videojs/video.js/issues/8345 But i'm starting to think its the new native ios 16 player that is causing issues and not the library itself.
0
0
995
Jul ’23
Unexpected errors when using AVPlayer in iOS 16
Hi, I'm trying to add a video to my first iOS app. From the tutorials I've read online, this seemed to be a simple process of creating a AVPlayer, providing a URL to the video file and using onAppear to start the video playing when the view is shown. Below is a simplified version of the code I'm using in my app: struct ContentView: View {   let avPlayer = AVPlayer(url: Bundle.main.url(forResource: "Intro", withExtension: "mp4")!)   var body: some View {     VStack{       VideoPlayer(player: avPlayer)         .onAppear{           avPlayer.play()         }     }   } } When I run this code, the video plays but when it finishes playing I receive the following errors in the Xcode output window: 2023-01-27 11:56:39.530526+1100 TestVideo[29859:2475750] [api] -[CIImage initWithCVPixelBuffer:options:] failed because the buffer is nil. 2023-01-27 11:56:39.676462+1100 TestVideo[29859:2475835] [TextIdentificationService] Text LID dominant failure: lidInconclusive 2023-01-27 11:56:39.676822+1100 TestVideo[29859:2475835] [VisualTranslationService] Visual isTranslatable: NO; not offering translation: lidInconclusive 2023-01-27 11:56:40.569337+1100 TestVideo[29859:2476091] Metal API Validation Enabled I have googled each of these error messages but have not been able to find any information explaining exactly what they mean or how to eliminate them. I am using Xcode 14.2 and testing on iOS 16.2. If anyone could please point me in the right direction of how to understand and eliminate these errors I'd really appreciate it. Thanks!
4
3
3.0k
Jul ’23
MPNowPlayingInfoCenter not fully available if player playback controls disabled
If I disable playback controls for an AVPlayer (showsPlaybackControls), some feature of MPNowPlayingInfoCenter no longer working. (play/pause, skip forward and backward). I need custom video and audio controls on my AVPlayer in my app, that's why I disabled the iOS playback controls. But I also need the features of the MPNowPlayingInfoCenter. Is there another solution to achieve this?
1
0
1.3k
Jul ’23
Cinematic Video with AVAsynchronousCIImageFilteringRequest
Are there plans to expose the cinematic frames (e.g. disparity) to a AVAsynchronousCIImageFilteringRequest? I want to use my own lens blur shader on the cinematic frames. Right now it looks like the cinematic frames are only available in a AVAsynchronousVideoCompositionRequest like this: guard let sourceFrame = SourceFrame(request: request, cinematicCompositionInfo: cinematicCompositionInfo) else { return } let disparity = sourceFrame.disparityBuffer
0
0
732
Jul ’23
Permissions when creating an album for an app and saving media
I am trying to create an album for an app in photo_kit and store images in it, is there any way to do this under the NSPhotoLibraryAddUsageDescription permission? At first glance, using NSPhotoLibraryAddUsageDescription seems to be the best choice for this app, since I will not be loading any images. However, there are two album operations that can only be done under NSPhotoLibraryUsageDescription. Creating an album Even though the creation of an album does not involve loading media, it is necessary to use NSPhotoLibraryUsageDescription to allow users to load media. This is a bit unconvincing. Saving images in the created album Before saving, you must check to see if the app has already created the album. You need to fetch the name as a key. This is where NSPhotLibraryUsageDescription is needed. I understand that the NSPhotLibraryUsageDescription is needed for fetching, but if iOS forbids the creation of albums with the same name and ignores attempts to create an album with an already existing name, this fetching will not be necessary. In summary, I just want to create an album for my app and store media in it, but in order to do so I need to get permission from the user to read into the photos, which goes against the idea that the permissions I request should be minimal and only what I need. If there is a way to do this under the NSPhotoLibraryAddUsageDescription permission I would like to know, I am new to Swift so sorry if I am wrong.
1
0
1.3k
Jul ’23
Why does video volume goes down after mic permission is granted on iOS browser?
Background I am building a web app where users can talk to a microphone and watch dynamic video that changes depending on what they say. Here is a sample flow: User accesses the page Mic permission popup appears, user grants it User presses start buttton, standby video starts playing and mic turns on User speaks something, the speech gets turned to text, analyzed, and based on that, the src changes The new video plays, mic turns on, the loop continues. Problem The problem in iOS is that volume goes down dramatically to a level where it is hard to hear on max volume if mic access is granted. iPhone's volume up/down buttons don't help much either. That results in a terrible UX. I think the OS is forcefully keeping the volume down, but I could not find any documentation about it. On the contrary, if mic permission not granted, the volume does not change, video plays in a normal volume. Question Why does it happen and what can I do prevent volume going down automatically? Any help would be appreciated. This will not happen in PC(MacOS, Windows) or Android OS. Has anyone had any similar experience before? Context For context: I have two tags(positioned:absolute, with and height 100%) that are switched(by toggling z-indexs) to appear one on top of the other. This is to hide load, buffer and black screen from the user for better UX. If the next video is loaded and can play, then they are switched places. both tags have playsinline to enable inline play as required by webKit. both tags start out muted, muted is removed after play starts. video.play() is initiated after user grants mic permission Tech stack NextJS with Typescript, latest versions Testing on latest Chrome and Safari on iOS 16 fully updated
2
1
1.6k
Jun ’23
nominalFrameRate is 30 for 240 slow motion video
I am currently working on a SwiftUI video app. When I load a slow motion video being in 240 IPS (239.68), I use "asset.loadTracks" and then ".load(.nominalFrameRate)" which returns 30 IPS (29.xx), asset being AVAsset(url: ). And the duration in asset.load(.duration) is also 8 times bigger than original duration. Do you know how to get this 239.68 displayed in the Apple Photo app ? Is it stored somewhere in the video metadata or is it computed ?
0
0
944
Jun ’23
PhotosPickerItem‘s loadTransferable method has a problem with some raw format photos
item.loadTransferable(type: Data.self) { result in switch result { case .success(let data): guard let data = data, let image = UIImage(data: data) else { break } imageView.image = image case .failure(let error): ... } } I load the raw format photo through the above code, but the displayed image is very blurry and messed up. But not all raw format photos will be like this, what is the reason?
0
0
779
May ’23
Bracketed capture photos have badly clipped highlights
Bracketed photo capture with iPhone 14 Pro produces photos with oddly clipped highlights. Rather than pixel values clipping normally to white when too bright, there is a sudden and harsh jump from gray to white. See image below that shows a comparison of a normal photo capture (using qualityPriorization .speed) and a bracketed capture. Note the massive difference in clipping behavior. Here's how I am configuring the bracketed capture: let bracketedStillImageSettings = AVCaptureAutoExposureBracketedStillImageSettings.autoExposureSettings(exposureTargetBias: 0.0) let bracketSettings = AVCapturePhotoBracketSettings(rawPixelFormatType: 0 as OSType, processedFormat: [AVVideoCodecKey: AVVideoCodecType.jpeg], bracketedSettings: [bracketedStillImageSettings]) photoOutput.capturePhoto(with: bracketSettings, delegate: photoCaptureProcessor) Things I've tried that don't make a difference: Changing AVCapturePhotoBracketSettings.photoQualityPrioritization to values of .speed, .balanced, or .quality Changing device type .builtInTripleCamera, .builtInUltraWideCamera, .builtInWideCamera, .builtInDualCamera, etc Changing capture format from jpeg to hevc Any ideas?
0
0
973
May ’23
IOS App Ionic Vue Problem with Video
I have implemented an app with ionicvue. On one page I want to display videos with the HTML5 video control, e.g. video src="https://media.geeksforgeeks.org/wp-content/uploads/20210314115545/sample-video.mp4" .... it works on web, on android, but it does not work on iOS. There is only a play button with a strike through line I have tried all of the available option conbinations (controls playsinline webkit-playsinline etc.) but it does not help. Any Ideas? Thanks a lot Alex
1
0
981
Apr ’23
adding a slideshow to webview app
hello I have created a webview app but it got rejected for not being interactive enough or not using iOS features. so I want to put an image slideshow in. however I get an error code when trying to put the code in code-block // //  ContentView.swift //  BEMCO iOS // //  Created by Lewis Dunn on 06/01/2023. // import SwiftUI import WebKit import UIKit struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView()     } } struct ContentView: View {     let webView = WebView(request: URLRequest(url: URL(string: "https://www.apple.com")!))     var body: some View {         VStack {             webView             HStack {                 Button(action: {                     self.webView.goBack()                 }) {                     Image(systemName: "arrowshape.left")                         .font(.title)                         .foregroundColor(.blue)                     }                 Spacer()                 Button(action: {                     self.webView.goHome()                 }) {                     Image(systemName: "house.fill")                         .font(.title)                         .foregroundColor(.blue)                 }                 Spacer()                 Button(action: {                     self.webView.goForward()                 }) {                     Image(systemName: "arrowshape.right")                         .font(.title)                         .foregroundColor(.blue)                 }             }         }     } } struct WebView: UIViewRepresentable {     let request: URLRequest     private var webView: WKWebView?     init (request: URLRequest) {         self.webView = WKWebView()         self.request = request     }     func makeUIView(context: Context) -> WKWebView { return webView!     }     func updateUIView(_ uiView: WKWebView, context: Context) {         uiView.load(request)     }     func goBack() {     webView?.goBack()   }     func goForward() {   webView?.goForward()     }     func goHome() {         webView?.load(request)     } } @State private var currentIndex = 0 _**(error is here: property wrappers are not supported in top level code) **_ let images : [String] = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"] var body : some View {     VStack {         Image(images[currentIndex])             .resizable()             .scaledToFit()         HStack{             ForEach(0..<images.count){ index in                 Circle()                     .fill(self.currentIndex == index ? Color.gray : Color.blue) _**(cannot find self in scope)**_                     .frame(width: 10, height: 10)             }         }         .onAppear{             print("Appear")             // We are going to use Timers             Timer.scheduledTimer(withTimeInterval: 2, repeats: true){ timer in                 if self.currentIndex + 1 == self.images.count{                     self.currentIndex = 0                 }else{                     self.currentIndex += 1                 }             }         }     } }
4
0
1.1k
Apr ’23
adding slideshow to app
hello I am trying to add a slideshow to my app but I am getting 2 error messages and 1 warning the code is as follows: // ContentView.swift // BEMCO iOS // // Created by Lewis Dunn on 06/01/2023. // import SwiftUI import WebKit import UIKit struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } struct MainView : View { var body : some View { VStack { } } struct MainViewController : UIViewControllerRepresentable { func makeUIViewController(context: UIViewControllerRepresentableContext<MainViewController>) -> UIHostingController<MainView> { return UIHostingController(rootView: MainView()) } func updateUIViewController(_ uiViewController: UIHostingController<MainView>, context: UIViewControllerRepresentableContext<MainViewController>) { let viewController = UIHostingController<MainViewController>(rootView:MainViewController())} } } struct ContentView: View { let webView = WebView(request: URLRequest(url: URL(string: "https://www.bemcouk.com")!)) var body: some View { VStack { webView HStack { Button(action: { self.webView.goBack() }) { Image(systemName: "arrowshape.left") .font(.title) .foregroundColor(.blue) } Spacer() Button(action: { self.webView.goHome() }) { Image(systemName: "house.fill") .font(.title) .foregroundColor(.blue) } Spacer() Button(action: { self.webView.goForward() }) { Image(systemName: "arrowshape.right") .font(.title) .foregroundColor(.blue) } } } } } struct WebView: UIViewRepresentable **{**2 errors are here _"UIViewRepresentable' requires the types 'some View' and 'Never' be equivalent _ and the other error is _"Type 'WebView' does not conform to protocol 'UIViewRepresentable'_** let request: URLRequest private var webView: WKWebView? init (request: URLRequest) { self.webView = WKWebView() self.request = request } func makeUIView(context: Context) -> WKWebView { return webView! } func updateUIView(_ uiView: WKWebView, context: Context) { uiView.load(request) } func goBack() { webView?.goBack() } func goForward() { webView?.goForward() } func goHome() { webView?.load(request) } @State private var currentIndex = 0 let images : [String] = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"] let imagesCount = 19 var body : some View { VStack { Image(images[currentIndex]) .resizable() .scaledToFit() HStack{ ForEach(0..<imagesCount){ index in **warning is here. Non-constant range: argument must be an integer literal** Circle() .fill(self.currentIndex == index ? Color.gray : Color.blue) .frame(width: 10, height: 10) } } .onAppear{ print("Appear") // We are going to use Timers Timer.scheduledTimer(withTimeInterval: 2, repeats: true){ timer in if self.currentIndex + 1 == self.images.count{ self.currentIndex = 0 }else{ self.currentIndex += 1 } } } } } }
0
0
664
Mar ’23
HELP!! Please teach me, How can I create profile of photos in Mac?
Recently, I have matter of should change color of so many photos about 80000 picts. But, It's to hard to change it one by one. Actually, I want to change color with ''Match to image with ColorSync profile" of "Automator". But, I don't know some method to do it. Please teach me some method to do it. Should Ito create some profile in mac? Or, Should I search for other method? If I can create some profile, Please teach me the method both. (The pictures are taken by old film camera. There are already changed to digital image.) (They have color of "sepia color". I have to change color to "Normal".)
0
0
1.4k
Mar ’23
Quicktime Interactivity?
Is it still possible to tutor a QuickTime movie with hyperlinks? I'm building a website and I know at one point you could author a QuickTime movie that supported links inside the video - either to other timestamps in the video or to other web pages. I don't want to use a custom player, I'd prefer to use the system level. I've seen a really amazing example of this on the mobile version of the memory alpha (Star Trek nerds!) website. There is a movie that plays at the top of pages that is fully interactive. Is that still supported? Is it possible to author that way? I'm not making anything insanely complicate, I just thought it would be a nice way to build a website with tools I'm more comfortable working in.
Replies
1
Boosts
0
Views
1.6k
Activity
Aug ’23
Progressively supply media data
I'm trying to use the resourceLoader of an AVAsset to progressively supply media data. Unable to because the delegate asks for the full content requestsAllDataToEndOfResource = true. class ResourceLoader: NSObject, AVAssetResourceLoaderDelegate { func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForLoadingOfRequestedResource loadingRequest: AVAssetResourceLoadingRequest) -> Bool { if let ci = loadingRequest.contentInformationRequest { ci.contentType = // public.mpeg-4 ci.contentLength = // GBs ci.isEntireLengthAvailableOnDemand = false ci.isByteRangeAccessSupported = true } if let dr = loadingRequest.dataRequest { if dr.requestedLength > 200_000_000 { // memory pressure // dr.requestsAllDataToEndOfResource is true } } return true } } Also tried using a fragmented MP4 created using AVAssetWriter. But didn't work. Please let me know if it's possible for the AVAssetResourceLoader to not ask for the full content?
Replies
1
Boosts
0
Views
1.1k
Activity
Aug ’23
Swift: Save image with file name using PHPhotoLibrary and PHAssetCreationRequest
I  am trying to save an image to the user's photo library using PHPhotoLibrary and set the image file name at the time of saving suing the code below. This is working the first time, but if I then try to save the same image again with a different file name, it saves with the same file name as before. Is there something I need to add to let the system know to save a new version of the image with a new file name? Thank you PHPhotoLibrary.shared().performChanges ({ let assetType:PHAssetResourceType = .photo let request:PHAssetCreationRequest = .forAsset() let createOptions:PHAssetResourceCreationOptions = PHAssetResourceCreationOptions() createOptions.originalFilename = "\(fileName)" request.addResource(with: assetType, data: image.jpegData(compressionQuality: 1)!, options: createOptions) }, completionHandler: { success, error in if success == true && error == nil { print("Success saving image") } else { print("Error saving image: \(error!.localizedDescription)") } })
Replies
3
Boosts
0
Views
2.9k
Activity
Aug ’23
Video Streaming Protocols Supported
I am aware that HLS is required for most video streaming use cases (watching a movie, TV show, or YouTube video). This is a requirement for all apps. However, I am confused as to whether this would also apply to video chat/video conferencing apps. It would be inefficient to upload compressed video using rtmp/rtp, decompress it, and create HLS segments. Low latency requirements only make this worse. So, is it permissible to use other protocols for video conferencing use cases? Thanks
Replies
1
Boosts
0
Views
870
Activity
Jul ’23
Memory change photo order when music changes
Hi, when I try to make a memory of an album it keeps the order the photos are on in that album. However, if I change the music the order of the photos changes. Is this the expected behavior? Could we have it so that it doesn’t change the order?
Replies
1
Boosts
0
Views
884
Activity
Jul ’23
replay broken on ios 16 safari with application/x-mpegURL (HLS)
Hi, Replay doesn't work on HLS videos (.m3u8) on ios 16 safari when you get to the end of a video. It works on .mp4s, .movs, etc. I have written a github issue on the videojs repo here: https://github.com/videojs/video.js/issues/8345 But i'm starting to think its the new native ios 16 player that is causing issues and not the library itself.
Replies
0
Boosts
0
Views
995
Activity
Jul ’23
Unexpected errors when using AVPlayer in iOS 16
Hi, I'm trying to add a video to my first iOS app. From the tutorials I've read online, this seemed to be a simple process of creating a AVPlayer, providing a URL to the video file and using onAppear to start the video playing when the view is shown. Below is a simplified version of the code I'm using in my app: struct ContentView: View {   let avPlayer = AVPlayer(url: Bundle.main.url(forResource: "Intro", withExtension: "mp4")!)   var body: some View {     VStack{       VideoPlayer(player: avPlayer)         .onAppear{           avPlayer.play()         }     }   } } When I run this code, the video plays but when it finishes playing I receive the following errors in the Xcode output window: 2023-01-27 11:56:39.530526+1100 TestVideo[29859:2475750] [api] -[CIImage initWithCVPixelBuffer:options:] failed because the buffer is nil. 2023-01-27 11:56:39.676462+1100 TestVideo[29859:2475835] [TextIdentificationService] Text LID dominant failure: lidInconclusive 2023-01-27 11:56:39.676822+1100 TestVideo[29859:2475835] [VisualTranslationService] Visual isTranslatable: NO; not offering translation: lidInconclusive 2023-01-27 11:56:40.569337+1100 TestVideo[29859:2476091] Metal API Validation Enabled I have googled each of these error messages but have not been able to find any information explaining exactly what they mean or how to eliminate them. I am using Xcode 14.2 and testing on iOS 16.2. If anyone could please point me in the right direction of how to understand and eliminate these errors I'd really appreciate it. Thanks!
Replies
4
Boosts
3
Views
3.0k
Activity
Jul ’23
MPNowPlayingInfoCenter not fully available if player playback controls disabled
If I disable playback controls for an AVPlayer (showsPlaybackControls), some feature of MPNowPlayingInfoCenter no longer working. (play/pause, skip forward and backward). I need custom video and audio controls on my AVPlayer in my app, that's why I disabled the iOS playback controls. But I also need the features of the MPNowPlayingInfoCenter. Is there another solution to achieve this?
Replies
1
Boosts
0
Views
1.3k
Activity
Jul ’23
Does Swift support saving videos from `Data` to the Photos app?
Can I do the same with the image? PHAssetChangeRequest.creationRequestForAsset(from: UIImage(data: bytes)
Replies
2
Boosts
0
Views
1.4k
Activity
Jul ’23
Cinematic Video with AVAsynchronousCIImageFilteringRequest
Are there plans to expose the cinematic frames (e.g. disparity) to a AVAsynchronousCIImageFilteringRequest? I want to use my own lens blur shader on the cinematic frames. Right now it looks like the cinematic frames are only available in a AVAsynchronousVideoCompositionRequest like this: guard let sourceFrame = SourceFrame(request: request, cinematicCompositionInfo: cinematicCompositionInfo) else { return } let disparity = sourceFrame.disparityBuffer
Replies
0
Boosts
0
Views
732
Activity
Jul ’23
Permissions when creating an album for an app and saving media
I am trying to create an album for an app in photo_kit and store images in it, is there any way to do this under the NSPhotoLibraryAddUsageDescription permission? At first glance, using NSPhotoLibraryAddUsageDescription seems to be the best choice for this app, since I will not be loading any images. However, there are two album operations that can only be done under NSPhotoLibraryUsageDescription. Creating an album Even though the creation of an album does not involve loading media, it is necessary to use NSPhotoLibraryUsageDescription to allow users to load media. This is a bit unconvincing. Saving images in the created album Before saving, you must check to see if the app has already created the album. You need to fetch the name as a key. This is where NSPhotLibraryUsageDescription is needed. I understand that the NSPhotLibraryUsageDescription is needed for fetching, but if iOS forbids the creation of albums with the same name and ignores attempts to create an album with an already existing name, this fetching will not be necessary. In summary, I just want to create an album for my app and store media in it, but in order to do so I need to get permission from the user to read into the photos, which goes against the idea that the permissions I request should be minimal and only what I need. If there is a way to do this under the NSPhotoLibraryAddUsageDescription permission I would like to know, I am new to Swift so sorry if I am wrong.
Replies
1
Boosts
0
Views
1.3k
Activity
Jul ’23
Why does video volume goes down after mic permission is granted on iOS browser?
Background I am building a web app where users can talk to a microphone and watch dynamic video that changes depending on what they say. Here is a sample flow: User accesses the page Mic permission popup appears, user grants it User presses start buttton, standby video starts playing and mic turns on User speaks something, the speech gets turned to text, analyzed, and based on that, the src changes The new video plays, mic turns on, the loop continues. Problem The problem in iOS is that volume goes down dramatically to a level where it is hard to hear on max volume if mic access is granted. iPhone's volume up/down buttons don't help much either. That results in a terrible UX. I think the OS is forcefully keeping the volume down, but I could not find any documentation about it. On the contrary, if mic permission not granted, the volume does not change, video plays in a normal volume. Question Why does it happen and what can I do prevent volume going down automatically? Any help would be appreciated. This will not happen in PC(MacOS, Windows) or Android OS. Has anyone had any similar experience before? Context For context: I have two tags(positioned:absolute, with and height 100%) that are switched(by toggling z-indexs) to appear one on top of the other. This is to hide load, buffer and black screen from the user for better UX. If the next video is loaded and can play, then they are switched places. both tags have playsinline to enable inline play as required by webKit. both tags start out muted, muted is removed after play starts. video.play() is initiated after user grants mic permission Tech stack NextJS with Typescript, latest versions Testing on latest Chrome and Safari on iOS 16 fully updated
Replies
2
Boosts
1
Views
1.6k
Activity
Jun ’23
nominalFrameRate is 30 for 240 slow motion video
I am currently working on a SwiftUI video app. When I load a slow motion video being in 240 IPS (239.68), I use "asset.loadTracks" and then ".load(.nominalFrameRate)" which returns 30 IPS (29.xx), asset being AVAsset(url: ). And the duration in asset.load(.duration) is also 8 times bigger than original duration. Do you know how to get this 239.68 displayed in the Apple Photo app ? Is it stored somewhere in the video metadata or is it computed ?
Replies
0
Boosts
0
Views
944
Activity
Jun ’23
PhotosPickerItem‘s loadTransferable method has a problem with some raw format photos
item.loadTransferable(type: Data.self) { result in switch result { case .success(let data): guard let data = data, let image = UIImage(data: data) else { break } imageView.image = image case .failure(let error): ... } } I load the raw format photo through the above code, but the displayed image is very blurry and messed up. But not all raw format photos will be like this, what is the reason?
Replies
0
Boosts
0
Views
779
Activity
May ’23
Bracketed capture photos have badly clipped highlights
Bracketed photo capture with iPhone 14 Pro produces photos with oddly clipped highlights. Rather than pixel values clipping normally to white when too bright, there is a sudden and harsh jump from gray to white. See image below that shows a comparison of a normal photo capture (using qualityPriorization .speed) and a bracketed capture. Note the massive difference in clipping behavior. Here's how I am configuring the bracketed capture: let bracketedStillImageSettings = AVCaptureAutoExposureBracketedStillImageSettings.autoExposureSettings(exposureTargetBias: 0.0) let bracketSettings = AVCapturePhotoBracketSettings(rawPixelFormatType: 0 as OSType, processedFormat: [AVVideoCodecKey: AVVideoCodecType.jpeg], bracketedSettings: [bracketedStillImageSettings]) photoOutput.capturePhoto(with: bracketSettings, delegate: photoCaptureProcessor) Things I've tried that don't make a difference: Changing AVCapturePhotoBracketSettings.photoQualityPrioritization to values of .speed, .balanced, or .quality Changing device type .builtInTripleCamera, .builtInUltraWideCamera, .builtInWideCamera, .builtInDualCamera, etc Changing capture format from jpeg to hevc Any ideas?
Replies
0
Boosts
0
Views
973
Activity
May ’23
IOS App Ionic Vue Problem with Video
I have implemented an app with ionicvue. On one page I want to display videos with the HTML5 video control, e.g. video src="https://media.geeksforgeeks.org/wp-content/uploads/20210314115545/sample-video.mp4" .... it works on web, on android, but it does not work on iOS. There is only a play button with a strike through line I have tried all of the available option conbinations (controls playsinline webkit-playsinline etc.) but it does not help. Any Ideas? Thanks a lot Alex
Replies
1
Boosts
0
Views
981
Activity
Apr ’23
CNContactViewController no "Take Photo" option in iPad
CNContactViewController has no "Take Photo" option when adding a contact photo when in iPad. It shows in iPhones though. iPad Devices: iPad 6th (iOS 16), iPad 9th (iOS 15.6.1)
Replies
0
Boosts
0
Views
610
Activity
Apr ’23
adding a slideshow to webview app
hello I have created a webview app but it got rejected for not being interactive enough or not using iOS features. so I want to put an image slideshow in. however I get an error code when trying to put the code in code-block // //  ContentView.swift //  BEMCO iOS // //  Created by Lewis Dunn on 06/01/2023. // import SwiftUI import WebKit import UIKit struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView()     } } struct ContentView: View {     let webView = WebView(request: URLRequest(url: URL(string: "https://www.apple.com")!))     var body: some View {         VStack {             webView             HStack {                 Button(action: {                     self.webView.goBack()                 }) {                     Image(systemName: "arrowshape.left")                         .font(.title)                         .foregroundColor(.blue)                     }                 Spacer()                 Button(action: {                     self.webView.goHome()                 }) {                     Image(systemName: "house.fill")                         .font(.title)                         .foregroundColor(.blue)                 }                 Spacer()                 Button(action: {                     self.webView.goForward()                 }) {                     Image(systemName: "arrowshape.right")                         .font(.title)                         .foregroundColor(.blue)                 }             }         }     } } struct WebView: UIViewRepresentable {     let request: URLRequest     private var webView: WKWebView?     init (request: URLRequest) {         self.webView = WKWebView()         self.request = request     }     func makeUIView(context: Context) -> WKWebView { return webView!     }     func updateUIView(_ uiView: WKWebView, context: Context) {         uiView.load(request)     }     func goBack() {     webView?.goBack()   }     func goForward() {   webView?.goForward()     }     func goHome() {         webView?.load(request)     } } @State private var currentIndex = 0 _**(error is here: property wrappers are not supported in top level code) **_ let images : [String] = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"] var body : some View {     VStack {         Image(images[currentIndex])             .resizable()             .scaledToFit()         HStack{             ForEach(0..<images.count){ index in                 Circle()                     .fill(self.currentIndex == index ? Color.gray : Color.blue) _**(cannot find self in scope)**_                     .frame(width: 10, height: 10)             }         }         .onAppear{             print("Appear")             // We are going to use Timers             Timer.scheduledTimer(withTimeInterval: 2, repeats: true){ timer in                 if self.currentIndex + 1 == self.images.count{                     self.currentIndex = 0                 }else{                     self.currentIndex += 1                 }             }         }     } }
Replies
4
Boosts
0
Views
1.1k
Activity
Apr ’23
adding slideshow to app
hello I am trying to add a slideshow to my app but I am getting 2 error messages and 1 warning the code is as follows: // ContentView.swift // BEMCO iOS // // Created by Lewis Dunn on 06/01/2023. // import SwiftUI import WebKit import UIKit struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } struct MainView : View { var body : some View { VStack { } } struct MainViewController : UIViewControllerRepresentable { func makeUIViewController(context: UIViewControllerRepresentableContext<MainViewController>) -> UIHostingController<MainView> { return UIHostingController(rootView: MainView()) } func updateUIViewController(_ uiViewController: UIHostingController<MainView>, context: UIViewControllerRepresentableContext<MainViewController>) { let viewController = UIHostingController<MainViewController>(rootView:MainViewController())} } } struct ContentView: View { let webView = WebView(request: URLRequest(url: URL(string: "https://www.bemcouk.com")!)) var body: some View { VStack { webView HStack { Button(action: { self.webView.goBack() }) { Image(systemName: "arrowshape.left") .font(.title) .foregroundColor(.blue) } Spacer() Button(action: { self.webView.goHome() }) { Image(systemName: "house.fill") .font(.title) .foregroundColor(.blue) } Spacer() Button(action: { self.webView.goForward() }) { Image(systemName: "arrowshape.right") .font(.title) .foregroundColor(.blue) } } } } } struct WebView: UIViewRepresentable **{**2 errors are here _"UIViewRepresentable' requires the types 'some View' and 'Never' be equivalent _ and the other error is _"Type 'WebView' does not conform to protocol 'UIViewRepresentable'_** let request: URLRequest private var webView: WKWebView? init (request: URLRequest) { self.webView = WKWebView() self.request = request } func makeUIView(context: Context) -> WKWebView { return webView! } func updateUIView(_ uiView: WKWebView, context: Context) { uiView.load(request) } func goBack() { webView?.goBack() } func goForward() { webView?.goForward() } func goHome() { webView?.load(request) } @State private var currentIndex = 0 let images : [String] = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"] let imagesCount = 19 var body : some View { VStack { Image(images[currentIndex]) .resizable() .scaledToFit() HStack{ ForEach(0..<imagesCount){ index in **warning is here. Non-constant range: argument must be an integer literal** Circle() .fill(self.currentIndex == index ? Color.gray : Color.blue) .frame(width: 10, height: 10) } } .onAppear{ print("Appear") // We are going to use Timers Timer.scheduledTimer(withTimeInterval: 2, repeats: true){ timer in if self.currentIndex + 1 == self.images.count{ self.currentIndex = 0 }else{ self.currentIndex += 1 } } } } } }
Replies
0
Boosts
0
Views
664
Activity
Mar ’23
HELP!! Please teach me, How can I create profile of photos in Mac?
Recently, I have matter of should change color of so many photos about 80000 picts. But, It's to hard to change it one by one. Actually, I want to change color with ''Match to image with ColorSync profile" of "Automator". But, I don't know some method to do it. Please teach me some method to do it. Should Ito create some profile in mac? Or, Should I search for other method? If I can create some profile, Please teach me the method both. (The pictures are taken by old film camera. There are already changed to digital image.) (They have color of "sepia color". I have to change color to "Normal".)
Replies
0
Boosts
0
Views
1.4k
Activity
Mar ’23