Questions tagged [avplayer]
An AVPlayer object is used to implement controllers and user interfaces for single- or multiple-item playback.
3,530
questions
0
votes
0
answers
11
views
How to develop AVPlayerItem observers using Combine
I want to develop AVPlayerItem observers using combine. I found a Example code using PassthroughSubject but this is not what I'm looking for I want more generic way of doing it.
-2
votes
2
answers
43
views
how to add a delay to mp3 streaming in swift AVPlayer [closed]
I use AVPlayer for streaming mp3 file from the internet and i want to give the user a option to delay the audio the seconds he want.
Is there any tip of how to do it or what should i start looking for?...
0
votes
0
answers
25
views
how play text to speech in background from push notification in swift
I am developing an app in Swift where I am facing an issue in playing text to speech from push notifications in the background. The app is working fine and the text-to-speech is playing in the ...
0
votes
1
answer
27
views
Set the volume AVAudioPlayer#play(at:time)
I am using AVAudioPlayer in my app. I have a use case where user specifies the time in future for the sound to play. I can play the sound in background using background modes but I want to control the ...
0
votes
0
answers
12
views
AVPlayer Add Delay to Audio but Not Video (Swift)
I have an HLS live stream (from an external source, not one I created or can edit) with video and several audio options. I can successfully change the audio to one of the alternatives, but the ...
-1
votes
0
answers
54
views
Play multiple Videos Simultaneously in collectionview using swift AVPlayer
Need to display list of videos with simultaneously play and looping using collectionview.
Implemented:
VC1: list of users
VC2: users video list in collectionview
Using present concept to navigate from ...
0
votes
1
answer
26
views
How to show AVPlayer in UICollectionViewcell with Loader
I need to show Avplayer in CollectionviewCell with Loading view(activity indicator). Below are the code what I try
UIcollectionViewCell:- cell content view contains view & some buttons(like, ...
0
votes
0
answers
22
views
Native Video Player Controls with Flutter (AVPlayer and ExoPlayer)
Flutter's video player plugin does not provide controls. Chewie Player is a commonly used plugin that gives the video player an interface.
However, the controls chewie provides are built IN Flutter. ...
0
votes
0
answers
9
views
Scrubbing to a specific point in live event HLS video on iOS?
pardon me for my lack of knowledge on this, I was wondering if someone could point me in the right direction. Say if I wanted to scrub a live event HLS playlist, such as seek to the beginning of the ...
0
votes
0
answers
14
views
How to add segments to AVPlayer asset?
I have a local mp3 audio file that I would like to break up into segments or chapters. I wanted to present all the segments in a list and highlight which segmented is currently playing.
This is what I'...
5
votes
2
answers
112
views
How to play video from ipfs url using avplayer in swift
I have an ipfs encrypted video URL.
I am not able to play video in avplayer but URL plays well in webview.
here is URL: https://ipfs.moralis.io:2053/ipfs/QmUjWnQZVVNmTSVak2QDhTxMkn3dPQozxawa1sm3jE5bLr
...
0
votes
0
answers
11
views
prevent avplayer from pausing other videos (ie. videos playing in a wkwebview)
I have a video playing in a wkwebview.
If I start another video playing in a native avplayer instance the wkwebview video pauses. And vice-versa.
This is within a single app.
Is there a way to allow ...
0
votes
0
answers
7
views
AVPlayer fail to play audio with error - The operation could not be completed -1180
I am trying to play audio in the background. This works fine, but sometimes the next track does not play and we also see no logs in analytics (analytics for logging error/events). But if the app is ...
0
votes
0
answers
22
views
How to use AVComposition instead of AVQueuePlayer?
I have about 200 local audio files displayed in a table that I would like to play in order. As each audio file plays, it will auto-scroll to the row.
Initially, I was trying to use AVQueuePlayer, but ...
2
votes
0
answers
44
views
Capture AVPlayer video with AVCaptureSession Screen Recording
I'm capturing one view through AVCaptureSession for Screen Recording.Now I want to record one mp4 video in that view which will play through AVPlayer.Screen Recording is working fine if I set some ...
0
votes
0
answers
30
views
Can't get SPC key for DRM video - AVPlayer [Swift]
We have successfully integrated video DRM logic using AVAssetResourceLoaderDelegate.
It worked well. But lately, after playing the same movie several times in a row, we started getting this error when ...
0
votes
0
answers
26
views
How to unpause apple music, when AVPlayer in Swift is paused in my app?
Music from AppleMusic paused, when music from my app is started. Is it possible to unpause music from background?
do {
player = try AVAudioPlayer(contentsOf: url)
player.delegate = ...
0
votes
0
answers
37
views
swiftUI AVPlayer adding time observer causes the screen to freeze
I have a music player app, using swiftUI to build the interface, MusicPlayerVM is similar to this,
class MusicPlayer: NSObject, ObservableObject {
let player: AVPlayer = {
let _player = ...
0
votes
0
answers
57
views
How to play .ts files using AVPlayer?
I'm working on a streaming project and i have to create player abstraction to play .ts files. sadly i didnt find any info(excluding 10 year old thread) how to make avplayer play .ts extensions. can ...
0
votes
0
answers
42
views
Keeping playback buttons layout in iOS 16
Does anyone know if it is possible to keep the iOS 15 playback button layout instead of the new iOS 16 layout? (see image attached)
I mean, keeping the compact playback buttons at the bottom of the ...
0
votes
0
answers
77
views
Playback buttons do not appear in an AVPlayer after adding a layer - iOS 16
I am using an AVPlayer to present a video. The app has only one .mp4 but for a different use case, the same video needs to get flipped.
The buttons are there and completely functional, you can press ...
0
votes
0
answers
18
views
Swift AVKit aspect ratio not working correctly
I want to surround the below PlayerView with a border. I want the video to scale to aspect ratio (it does) but when I draw the border around it, it seems like the PlayerView is formatted as a square......
0
votes
1
answer
43
views
AVPlayer problem with HLS lives material and currentTime
I use AvPlayer to run HLS playlist in my iOS app. Everything works fine (seeking, play, pause and so on...) except 'currentTime' for LIVE materials.
Short Code:
public final class CustomPlayer: ...
0
votes
0
answers
19
views
How to display video without default controls, but use your own. YoutubeAPI. Swift. AVPlayer [duplicate]
I'm trying to get a video from YouTube API. But I don't need embedded video. Or rather, I do not need the controls that are in the version with embedded video. I need to manage my own. Does YouTube ...
0
votes
0
answers
104
views
AssetsAudioPlayer the operation could not be completed iOS
I'm using Flutter Sound Recorder as recorder for my audio files and I'm trying to open the audio file with AssetsAudioPlayer but I'm getting this error:
url: file:///var/mobile/Containers/Data/...
0
votes
0
answers
53
views
Rewind in Live Streaming (HLS) with AVPlayer
I'm using an HLS url to stream live video. And I need the ability to go back to an arbitrary place in the past, within a two-hour "window," but when I try to do that, I can only go for a few ...
0
votes
1
answer
41
views
Async Video download (like AsyncImage) with AVPlayer?
I'm trying to fetch HLS footage from my firebase storage, and if I directly store the download URL in a variable and use that as my url for AVPlayer, the video plays smoothly. But, when I try to first ...
1
vote
0
answers
28
views
SwiftUI - AudioRecorder stop all device sounds
I'm trying to record sound with my Ipad while a video/music is playing with SwiftUI. But when I start AVAudioSession, my device sounds cut off, while I would like my video/music sound to continue. To ...
0
votes
1
answer
37
views
SwiftUI: Keep VideoPlayer playing while device is locked
title says it all as far as I'm aware. I have the following view:
struct VideoView: View{
@State var FilePath = ""
@State private var player = AVPlayer()
var body: some View{
...
0
votes
0
answers
38
views
Please help me that there is a problem playing the video with HTTP Live Streaming using AVPlayer
After approximately 1 to 2 seconds of video playback using AVPlayer, the image is crushed like a picture. But the sound comes out. Why is this problem happening?
issue picture:
correct picture:
...
1
vote
0
answers
62
views
Pre-load videos and cache them - swift
I have collectionView and each cell has a video displayed.
When a cell is tapped I present a ViewController that plays the video.
The code that does this in the ViewController is as follows:
...
0
votes
0
answers
28
views
Disable that AVPlayerView stops video when pressing the pause ⏯️ key
Currently I am using an AVPlayerView in combination with an AVPlayer in my Cocoa App.
The video plays fine but I want to disable that the AVPlayerView or AVPlayer responds to key presses that for ...
1
vote
0
answers
23
views
Hide subtitle track or audio track on the AirPlay device
I have a HLS manifest with multiple audio and multiple subtitle tracks. I use AVPlayer on iOS to play this HLS asset.
On the iOS app I have the freedom to display selective subtitle and audio track ...
1
vote
0
answers
35
views
iOS development: navigate video chapters programmatically
I want to programmatically navigate chapters of a mp4 video.
The chapters work in QuickTime, so I assume the video format isn't the issue.
The code from this page should return an array of the ...
0
votes
0
answers
41
views
AVPlayer buffer
I use AVPlayer for video and I want to see how full is a buffer(in percent). Maybe are there some properties of player that I can use? I know just about "isPlaybackBufferFull" and "...
0
votes
0
answers
33
views
Using AVPlayer.currentItem?.asset.duration makes UI stop for some duration
I have a function that plays a song with the url i have given in it's parameters. I am using AVPlayer to do this.
func playSong(url:URL) {
self.playerItem = AVPlayerItem(url: url)
...
0
votes
1
answer
47
views
AVPlayer message was received but not handled
I am trying to implement a singleton class with AVPlayer in it. The key value observing throws exception. I think the object of this class is getting dealloced.
import Foundation
import UIKit
import ...
0
votes
1
answer
62
views
AVPlayer audio only works when ringer is on
With SwiftUI, I have a custom avplayer that auto plays and loops the video. The problem is whether or not I specifically tell avplayer to unmute, it is still muted. The physical volume buttons have no ...
0
votes
0
answers
12
views
get an error when I try to play a video: No factory registered for id <CFUUID 0x600000e57fe0>
I get an error when I try to play a video: nw_protocol_get_quic_image_block_invoke dlopen libquic failed.
I have already made: allow arbitrary loads = true and video is available
I try to play local ...
1
vote
0
answers
149
views
Show activity indicator and error while loading from url AVPlayer swiftui
I was trying to load short videos from a URL and I found the best way is to use AVPlayer, I found the code below but it didn't show the activity indicator also if the user doesn't have an internet it ...
1
vote
1
answer
80
views
AVPictureinPictureController - Can I pause pipController multiple times?
I'm using Picture in Picture(PiP) feature in my application using AVPictureInPictureController and it's delegate methods.
I want to call saveClipfunc() multiple times when click pause icon of ...
0
votes
0
answers
48
views
Syncing AVPlayer play (start) time with Timecode
I need my app to play a video (avplayer) at a specific time. Time in my app is represented through time code ("23:59:59:23").
I have a videos that need to play at specific timecode - for ...
0
votes
0
answers
42
views
How to bounce/reverse video playback
How does snapchat "bounce" video during playback on iOS? 👈(See GIF example) It's something I've attempted for years but failed to accomplish. Theres minimal resources on this topic and no ...
3
votes
1
answer
105
views
AVPlayerViewController plays audio through airplay when allowsExternalPlayback is false
I have a main video that plays through AVPlayerViewController that should be played through Airplay to e.g. the AppleTV. This is how I set up the view controller:
let player = AVPlayer(url: url)
let ...
0
votes
0
answers
25
views
Playback with AVPlayer produces no sound and no error
I am trying to playback a remote mp3 file by using the following code:
import AVFoundation
let url = NSURL(string: urlString)
let avPlayer = AVPlayer(url: url! as URL)
avPlayer.play()
I get no error ...
0
votes
0
answers
51
views
AVPlayer freezes in UITableViewCell when scrolling off
I have AVPlayer in my UITableViewCell which is the first cell in the table. When I scroll to bottom of the table and the video cell is not visible anymore, somehow the video freezes when I come back ...
0
votes
1
answer
30
views
Swift AVPlayer How To Stop Automatically When Audio Finished
I've created a button to play audio (streaming from a link) with AVPlayer in Swift. How to stop the audio automatically when the audio time is finished?
Here is some of my code :
var player : AVPlayer?...
0
votes
0
answers
130
views
Video preload in uicollectionview in swift
I am developing Instagram-like an app that has insta reels-like UI where videos are played in the list but what happens now is when cell comes on scree video buffers or loads and it takes 1-2 sec to ...
0
votes
0
answers
27
views
Swift AVPlayerLayer videoGravity .resizeAspect only respects height not width
I have an AVPlayer and AVPlayerLayer embedded in a simple UIView. This plays the movie but adjusting playerLayer.videoGravity only effects the movies relative height:
.resizeAspect fills all the way ...
7
votes
0
answers
43
views
AVPlayerViewController Airplay in the presence of external UIScene
I have a UISceneConfiguration for external screen which is triggered when external display is connected to iOS device.
// MARK: UISceneSession Lifecycle
@available(iOS 13.0, *)
func application(_ ...