Comments (5)
As I think you did, I read apple article:
https://developer.apple.com/documentation/avfoundation/media_playback_and_selection/selecting_subtitles_and_alternative_audio_tracks
I think we could work with ModernAVPlayer Plugin System (PlayerPlugin
):
- Media is loaded, plugin system call:
func didLoad(media: PlayerMedia, duration: Double?)
- I can add a
AVPlayerItem
(from custom protocol) param to this method - Then in the plugin, you can download group and options
- Then use the
AVPlayerItem
to select group and options previously download
In this case, I just have to provide in didLoad
player plugin method the AVPlayerItem previously loaded.
For information, add PlayerPlugin is done on ModernAVPlayer init
what do you think ?
from modernavplayer.
As I understand I can cast PlayerMedia to PlayerMediaItem in this method, right? Not quite get why there are two separate, however, plugin system will work for me, I was just thinking that this feature could be useful for others potentially and worth implementing internally
from modernavplayer.
ok, I just created a new branch -> you can now use it to access AVPlayerItem and AVAsset when item is loaded and call all methods suggested by Apple
I suggest you create a new GitHub open source repository to create a swift package for the plugin. (can be access by anybody, to use or update it)
- Create a new Swift Package Project
- Create your plugin code
- Use ModernAVPlayer repo or another one to create iOS example to test it
** Inject your plugin in ModernAVPlayer init
** Access to AVPlayerItem from didLoaded delegate method
** Start async task to download group and options
** Choose options you need (you will have iOS example in the project)
** Apply fromAVPlayerItem
select method
If you have any question, please ask !
PS: do not pay attention to unit tests, I had to adjust them...
from modernavplayer.
HI @yaroslavlvov ,
can you share a url of a media with subtitle or alternative audio tracks ?
I may try to help if I have some time
from modernavplayer.
@raphrel the one that you used for demo should have both
from modernavplayer.
Related Issues (20)
- Crash on PlayingState.swift - Line 193 PlayingState.routeAudioChanged(reason:) + 193 HOT 5
- signal SIGABRT on player.updateMetadata HOT 2
- When there are multiple instances, itemPlayToEndTime will interfere with each other HOT 1
- prevTrackCommand, nextTrackCommand are not available HOT 4
- Paused audio not resuming after phone call HOT 6
- Possible support for tvOS HOT 3
- MPRemoteCommandCenter/MPNowPlayingInfoCenter not working with default configuration HOT 6
- Precise seek missing HOT 3
- Add seekableTimeRanages didChange to ModernAVPlayerDelegate
- Infinite buffering in live stream
- ModernAVPlayerMedia preload and caching HOT 1
- Reloading playerItem in case of playback stall due to network issue causing limitations for consumers
- allow to set this player.automaticallyWaitsToMinimizeStalling in configuration
- Audio stops and won't resume after phone call HOT 2
- Fairplay and DRM support HOT 1
- i got two crash was positioned in ModernAVPlayerRemoteCommandFactory file
- Cache Audio for remote URL
- audio stops after 15-20 seconds HOT 1
- How can I set HTTP headers for URL of remote media?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modernavplayer.