avplayer | 一个基于FFmpeg、libtorrent的P2P播放器实现

 by   Jackarain C++ Version: Current License: No License

kandi X-RAY | avplayer Summary

kandi X-RAY | avplayer Summary

avplayer is a C++ library. avplayer has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

一直以来, 在多媒体播放器这块, 即使目前有许多开源的播放器项目, 但要写一个播放器仍然是件非常困难的事, 如果在windows上你有可能需要熟悉DShow, 另外的话, 你需要学习一堆开源项目(比如FFmpeg, MPC, VLC, Mplayer), 而且多数都是基于linux, 在windows上学习起来很不容易, 然而这些开源项目对于一些希望快速实现自己播放器, 就显得很困难. 因此, 我创建了这个项目, 致力于以最简单的方法实现自己的播放器, 并提供一个可以很方便使用的接口. 目前, 在这个代码中, 主要链接到FFmpeg来进行解码, 并将其改造成一个通用的播放器框架. 在这个框架中能够接受各种数据的读入, 可以很方便的封装自己的数据读取模块, 也可以很方便的定制自己的视频渲染模块和音频播放模块, 你只需要参考其中的实现即可. 另外在当前的实现中, 因为个人精力实在有限, 所以借鉴了一些开源项目的代码(如Mplayer), 并且该代码跨平台(目前在linux平台的实现稍简单). 所以, 我希望有朋友能参与到这个项目中一起研究和学习, 并完成这个目标.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              avplayer has a low active ecosystem.
              It has 382 star(s) with 261 fork(s). There are 71 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 6 open issues and 10 have been closed. On average issues are closed in 48 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of avplayer is current.

            kandi-Quality Quality

              avplayer has no bugs reported.

            kandi-Security Security

              avplayer has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              avplayer does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              avplayer releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of avplayer
            Get all kandi verified functions for this library.

            avplayer Key Features

            No Key Features are available at this moment for avplayer.

            avplayer Examples and Code Snippets

            No Code Snippets are available at this moment for avplayer.

            Community Discussions

            QUESTION

            Postpone init() AVPlayer SwitUI
            Asked 2021-Jun-14 at 19:54

            I have found the code for an OObject that serves me as a basic audio player (with a slider) Works fine , however i can use it so far in the ContentView like this :

            ...

            ANSWER

            Answered 2021-Jun-14 at 19:54

            In a non-SwiftUI situation, I'd normally recommend making player an optional and loading it later, but, as you've probably discovered, you can't make an @ObservedObject or @StateObject optional.

            I'd recommend refactoring AudioPlayerAV so that it does the important work in a different function than init. That way, you're free to load the content at whatever point you want.

            For example:

            Source https://stackoverflow.com/questions/67976166

            QUESTION

            How to go full screen with VideoPlayer() in SwiftUI?
            Asked 2021-Jun-04 at 09:10

            I'm using the following code in my project and it works great.

            But I need to know if its possible to play the video in full screen when the user taps on a button or any other action.

            This is my code:

            ...

            ANSWER

            Answered 2021-Jun-04 at 09:10

            Here's how I managed to do it. I hope this helps someone else in the future.

            This is a rough idea but it works as it was intended to.

            Basically, I've put the VideoPlayer in a VStack and gave it a full width and height.

            I gave the VStack a set height and full width.

            I gave the VStack a tapGesture and changed its width and height on double tap and this way, all its content (VideoPlayer) will resize accordingly.

            This is the code:

            Source https://stackoverflow.com/questions/67824702

            QUESTION

            URLSession: Any way to read a file as it is being downloaded?
            Asked 2021-Jun-01 at 16:08

            The use-case is that I want the user to be able to preview a song hosted at a remote URL. Fine, you say, just use AVPlayer. Yes, but I want to be able to cache the file locally if it is completely downloaded in the course of being previewed. As far as I can tell, there's no way to access the local data that AVPlayer downloads for its streaming playback. Likewise, there's no way to get access to the data being downloaded by URLSession until it is completely downloaded. So, I'd like to find a result using one of these approaches:

            1. Access the data in AVPlayer once it has completed downloading it and save to a file.
            2. Download the data progressively to the cached URL and have AVPlayer play it as enough data becomes available.

            Are either of these scenarios possible? Is there some other scenario which will achieve what I am looking to do?

            ...

            ANSWER

            Answered 2021-Jun-01 at 16:08

            So the solution to this came from the AlamoFire source code. If you use a URLSessionDataTask in the traditional, non-combine way and have a controller conforming to URLSessionDataDelegate, then you can implement the urlSession(_:dataTask:didReceive:) protocol method to receive the data as it arrives, rather than waiting to receive it at completion. This allows you to directly write the data to a file of your choosing that is completely under your app's control.

            Source https://stackoverflow.com/questions/67728010

            QUESTION

            AVPlayer.status doesn't run when wrapped in a DispatchWorkItem with a Delay
            Asked 2021-May-28 at 18:48

            Because I'm playing videos in cells I have an AVPlayer that plays videos in certain circumstances immediately and others it runs a few seconds later. When it runs immediately the .status works fine. But when I wrap it in a DispatchWorkItem with a .asyncAfter delay that same exact .status is never called. I also tried to use a perform(_:, with:, afterDelay:) and a Timer but this didn't work either.

            ...

            ANSWER

            Answered 2021-May-27 at 10:28

            Can you try to change the forKeyPath parameter value to #keyPath(AVPlayerItem.status)

            Source https://stackoverflow.com/questions/67720028

            QUESTION

            Swift - Not able to hide or unhide UIView considering I can see it
            Asked 2021-May-25 at 14:47

            I have a two-file project for a podcast player application. My goal is when the user clicks the Play Button (loaded in nib cell), there will be shown PodcastPlayerView (added to StoryBoard in View Controller) with play/pause.

            ...

            ANSWER

            Answered 2021-May-25 at 14:46

            QUESTION

            iOS MPNowPlayingInfoCenter not Displaying Using AVPlayer and AVAudioSession
            Asked 2021-May-17 at 21:48

            I am building a radio streaming app. The sound is working, including when the app is in the background and when the phone is locked. However, I can't get the MediaPlayer info to appear on the lock screen.

            I am attempting to use a combination of AVPlayer, AVAudioSession, and MPNowPlayingInfoCenter. I have looked at other questions on Stack Overflow (this one, especially), but it seems like their solutions aren't working for me.

            I will try to lay out the important aspects of my app:

            Info.plist

            Added Required background modes: App plays audio or streams audio/video using AirPlay

            AppDelegate.swift

            I added the following code to didFinishLaunchingWithOptions

            ...

            ANSWER

            Answered 2021-May-12 at 07:39

            Your code looks fine and you don't need the first responder stuff.

            Put a breakpoint on your AVAudioSession configuration and make sure it's actually being called or check that its log output is present.

            Make sure your audio is working in the background by locking the screen and listening.

            You also need to actually be playing audio to influence the now playing info screen.

            related

            Source https://stackoverflow.com/questions/67463023

            QUESTION

            SwiftUI background mode works in simulator but not on a real device?
            Asked 2021-May-14 at 20:13

            I'm playing an Audio in my app.

            I can play the audio in the background mode in the simulator but when I test the app in a real device, the audio Stops as soon as the App goes in the background.

            I have this in the background mode:

            and this is how I play the audio:

            ...

            ANSWER

            Answered 2021-May-14 at 20:13

            Add the following ode just at the beginning of OnAppear,

            Your code would look like this:

            Source https://stackoverflow.com/questions/67540011

            QUESTION

            SwiftUI - How do I Press button -> Autoplay video with no controls -> Do rest of button actions
            Asked 2021-May-13 at 16:56

            I am trying to make a video automatically play without any control buttons when a button is pressed and then after the video is done playing do the rest of the button actions.

            I can get the video to play if I put it above the ZStack, but when I try to make it play after hitting a button inside the ZStack, then I get an error that says "Result of 'VideoPlayer' initializer is unused" on the line where VideoPlayer is.

            ...

            ANSWER

            Answered 2021-May-13 at 16:56

            Regarding the VideoPlayer and loading different content for it, you need to put the VideoPlayer inside the view hierarchy. Right now, you have it inside the Button's action, which means that even if you didn't have a compiler error, it would show up in your view.

            Here's some code that loads different AVPlayers based on the state of number and autoplays the video:

            Source https://stackoverflow.com/questions/67519766

            QUESTION

            Playing Video (.MP4) from server that's behind Digest authentication in iOS Swift
            Asked 2021-May-01 at 09:25

            I'm a beginner in swift my problem is this:

            -I need to play a .MP4 video in my ios swift app - the server needs authentication

            let myVideoUrl = "playmyvidmp4123.org" [as an example]

            when I put myVideoUrl in a web browser a pop up appears and asks you to put in your username and password (authentication) so I put in my credentials:

            User: "sherry" pass: "789"

            then the video starts downloading

            How do I play these links in my app? I use alamofire for networking, so I use .Authenticate however how do I pass the data to AVPlayer/ somme player to play the video and allow for scrubbing as well

            There was a technique I did before, whereby when I get the data, I convert DATA to UIImage and then display the UIImage in my image view and constantly refresh the img by timers and it plays (there is no scrubbing functionality in it either)

            I do not know how to authenticate the server with the stock inbuilt method either i.e. without using alamofire. So please if someone knows, how may I accomplish this task - A code snippet would be much appreciated in which I can plug my creds, & link and test it out

            ...

            ANSWER

            Answered 2021-May-01 at 09:25

            Try to format your URL to video this way https://user:pass@url => https://sherry:789@playmyvidmp4123.org

            Source https://stackoverflow.com/questions/67343983

            QUESTION

            Xamarin IOS CrossMediaManager Background video playing
            Asked 2021-Apr-21 at 13:58

            I am using a videoview from https://github.com/Baseflow/XamarinMediaManager ,it works perfectly fine. I want audio to be continued played when the app goes in background or screen is locked, that can be achieved using the method given in this link https://developer.apple.com/documentation/avfoundation/media_playback_and_selection/creating_a_basic_video_player_ios_and_tvos/playing_audio_from_a_video_asset_in_the_background

            So I followed it as you can see my codes. I am getting currently PlayerViewController and AVPlayer and connecting and disconnecting them as done in the given class.

            ...

            ANSWER

            Answered 2021-Apr-21 at 13:58

            Looks like the bug in your code with deallocation CurrentAVPlayer on entering background in DisConnect method and it should be:

            Source https://stackoverflow.com/questions/67051817

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install avplayer

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/Jackarain/avplayer.git

          • CLI

            gh repo clone Jackarain/avplayer

          • sshUrl

            git@github.com:Jackarain/avplayer.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link