Saving buffer data of AVPlayer The Next CEO of Stack OverflowHow to stream a video with AVURLAsset and save to disk the cached dataCaching with AVPlayer and AVAssetExportSessionAVPlayer stalling on large video files using resource loader delegatePlaying a video from live stream while also saving the stream to disk on iOSAccess the data of AVPlayer when playing video from HTTP Live StreamingPassing Data between View ControllersTake screenshots in the iOS simulatorAVPlayer show cached dataAVPlayer streaming progressAccess the data of AVPlayer when playing video from HTTP Live StreamingAVPlayer buffering percentageHow to prevent AVPlayer pausing audio while buffering?AVPlayer : How to handle network interruptionsAVPlayer with EqualizerPlay audio url in avplayer with buffering progress - Swift

How can I open an app using Terminal?

Is HostGator storing my password in plaintext?

Only print output after finding pattern

Why is there a PLL in CPU?

Why do remote companies require working in the US?

Why is Miller's case titled R (Miller)?

How can I get through very long and very dry, but also very useful technical documents when learning a new tool?

What's the point of interval inversion?

A pseudo-riley?

If the heap is initialized for security, then why is the stack uninitialized?

Explicit solution of a Hamiltonian system

Horror movie/show or scene where a horse creature opens its mouth really wide and devours a man in a stables

How do I solve this limit?

Can a caster that cast Polymorph on themselves stop concentrating at any point even if their Int is low?

Anatomically Correct Mesopelagic Aves

What does "Its cash flow is deeply negative" mean?

Why do professional authors make "consistency" mistakes? And how to avoid them?

Why here is plural "We went to the movies last night."

Why does standard notation not preserve intervals (visually)

Why did we only see the N-1 starfighters in one film?

Why didn't Khan get resurrected in the Genesis Explosion?

What is meant by a M next to a roman numeral?

Can a single photon have an energy density?

Return of the Riley Riddles in Reverse



Saving buffer data of AVPlayer



The Next CEO of Stack OverflowHow to stream a video with AVURLAsset and save to disk the cached dataCaching with AVPlayer and AVAssetExportSessionAVPlayer stalling on large video files using resource loader delegatePlaying a video from live stream while also saving the stream to disk on iOSAccess the data of AVPlayer when playing video from HTTP Live StreamingPassing Data between View ControllersTake screenshots in the iOS simulatorAVPlayer show cached dataAVPlayer streaming progressAccess the data of AVPlayer when playing video from HTTP Live StreamingAVPlayer buffering percentageHow to prevent AVPlayer pausing audio while buffering?AVPlayer : How to handle network interruptionsAVPlayer with EqualizerPlay audio url in avplayer with buffering progress - Swift










10















I am playing audio from my server using AVPlayer in my application. Now i want that when it completely buffer the audio then i can save that data in the application to play it later. So any guide or help that how can i access buffer data and save it for later use










share|improve this question






















  • I know this is an old question. However, you can find the answer here: stackoverflow.com/questions/37611488/…

    – Gabriel.Massana
    Jun 3 '16 at 10:08















10















I am playing audio from my server using AVPlayer in my application. Now i want that when it completely buffer the audio then i can save that data in the application to play it later. So any guide or help that how can i access buffer data and save it for later use










share|improve this question






















  • I know this is an old question. However, you can find the answer here: stackoverflow.com/questions/37611488/…

    – Gabriel.Massana
    Jun 3 '16 at 10:08













10












10








10


11






I am playing audio from my server using AVPlayer in my application. Now i want that when it completely buffer the audio then i can save that data in the application to play it later. So any guide or help that how can i access buffer data and save it for later use










share|improve this question














I am playing audio from my server using AVPlayer in my application. Now i want that when it completely buffer the audio then i can save that data in the application to play it later. So any guide or help that how can i access buffer data and save it for later use







iphone ios cocoa-touch avplayer






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Aug 20 '13 at 5:58









Iqbal KhanIqbal Khan

2,51563776




2,51563776












  • I know this is an old question. However, you can find the answer here: stackoverflow.com/questions/37611488/…

    – Gabriel.Massana
    Jun 3 '16 at 10:08

















  • I know this is an old question. However, you can find the answer here: stackoverflow.com/questions/37611488/…

    – Gabriel.Massana
    Jun 3 '16 at 10:08
















I know this is an old question. However, you can find the answer here: stackoverflow.com/questions/37611488/…

– Gabriel.Massana
Jun 3 '16 at 10:08





I know this is an old question. However, you can find the answer here: stackoverflow.com/questions/37611488/…

– Gabriel.Massana
Jun 3 '16 at 10:08












5 Answers
5






active

oldest

votes


















-3














I think your issue would be similar to downloading audio or music files from the server and then playing them in your app. Anyways if you want to save the audio in your app , wouldn't it be better to download it and then play it ? Anyways please check these links



How to download audio files from a server into my iPhone application?



Download music file from server and save in my app



Hope they help.






share|improve this answer

























  • actually i want to play audio before it completely downloads, i want it to play as it download some part of audio file

    – Iqbal Khan
    Aug 20 '13 at 6:38











  • I have receive continue data from udp please suggest how can play continue like streaming

    – DURGESH Chaurasiya
    Jun 5 '17 at 11:57


















38














You could supply a resourceLoader delegate to take over control of the resource loading process from AVPlayer and then supply it the data as and when it requests and becomes available. The resource loader is a property on AVURLAsset. I've documented a full solution on my blog but the main idea is to switch the protocol of your URL to something custom so AVURLAsset's resource loader requires your application's assistance in loading that URL. Then when you get the AVAssetResourceLoaderDelegate callbacks, start downloading the file and try to respond to the pending requests received from those delegate callbacks as and when you have data. This will allow progressive loading/playback of the content without having to run a full blown HTTP server in your app or resorting to other complicated solutions.






share|improve this answer

























  • Great answer! I was about to go down the route of setting up a local http server that would somewhat act as a proxy, but this solution seems way more elegant. Will definitely give it a try.

    – quentinadam
    Aug 28 '14 at 22:51






  • 1





    The code on your blog works like a charm!

    – quentinadam
    Aug 29 '14 at 10:12











  • Do you know which changes I have to make to get this working for video files? For some reason the player status changes to failure. I basically just inserted a video file instead of mp3 and added an avplayerlayer. The download starts and everything looks fine, but then the player's status changes from 0 (unknown) to 2 (failure)

    – Nils Ziehn
    Sep 9 '14 at 10:21











  • Nice! Have you run into the problem described here? We've got the same issue: stackoverflow.com/questions/29683567/…

    – Hudson
    Apr 17 '15 at 15:11






  • 2





    the code works great for audio, but not for video :(

    – joey
    Mar 29 '16 at 0:37


















1














Easy to do...using the same url for your audio stream use NSURLConnection to get the data and save using NSFilehandler...just done it myself whilst streaming audio and saving at the same time to mp3...let me know if you need code sample...






share|improve this answer























  • yes,sure you can share the code for others, i had done that same thing that you just explain in the Answer and its working good.

    – Iqbal Khan
    Sep 11 '13 at 6:01











  • Can we please see a code sample of this? Maybe a gist on Github?

    – user3344977
    Apr 10 '15 at 6:32











  • Can we get this sample code pls?

    – inorganik
    Aug 21 '15 at 17:19











  • aren't you downloading the data twice by doing that? I wouldn't recommend

    – defense2000x
    Dec 5 '16 at 1:36



















1














The team at Calm has open-sourced our implementation to this. It's available as a CocoaPod. It's called PersistentStreamPlayer.



It acts as a resourceLoader. The big benefit over other implementations is that it does not require the binary data to be in memory at any point, so it supports larger files.



Features include:



  • streaming of audio file, starting playback as soon as first data is available

  • also saves streamed data to a file URL as soon as the buffer completes
    exposes timeBuffered, helpful for displaying buffer progress bars in the UI

  • handles re-starting the audio file after the buffer stream stalls (e.g. slow network)

  • simple play, pause and destroy methods (destroy clears all memory resources)

  • does not keep audio file data in memory, so that it supports large files that don't fit in RAM

You can find it here: https://github.com/calmcom/PersistentStreamPlayer






share|improve this answer























  • it mentions "Stream audio over http, and persist the data to a local file while buffering" does it work for video aswell ?

    – Bonnie
    Oct 25 '17 at 19:44


















0














You can't access the buffer of the AVPlayer. Some hints: You can put previews (short versions of audios) of your audio files on your server, so that Your users could listen the previews before they download the full audio files, or you may search for custom open source audio stream players, maybe those will allow you to access the stream buffer. Good Luck!






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f18327920%2fsaving-buffer-data-of-avplayer%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    5 Answers
    5






    active

    oldest

    votes








    5 Answers
    5






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    -3














    I think your issue would be similar to downloading audio or music files from the server and then playing them in your app. Anyways if you want to save the audio in your app , wouldn't it be better to download it and then play it ? Anyways please check these links



    How to download audio files from a server into my iPhone application?



    Download music file from server and save in my app



    Hope they help.






    share|improve this answer

























    • actually i want to play audio before it completely downloads, i want it to play as it download some part of audio file

      – Iqbal Khan
      Aug 20 '13 at 6:38











    • I have receive continue data from udp please suggest how can play continue like streaming

      – DURGESH Chaurasiya
      Jun 5 '17 at 11:57















    -3














    I think your issue would be similar to downloading audio or music files from the server and then playing them in your app. Anyways if you want to save the audio in your app , wouldn't it be better to download it and then play it ? Anyways please check these links



    How to download audio files from a server into my iPhone application?



    Download music file from server and save in my app



    Hope they help.






    share|improve this answer

























    • actually i want to play audio before it completely downloads, i want it to play as it download some part of audio file

      – Iqbal Khan
      Aug 20 '13 at 6:38











    • I have receive continue data from udp please suggest how can play continue like streaming

      – DURGESH Chaurasiya
      Jun 5 '17 at 11:57













    -3












    -3








    -3







    I think your issue would be similar to downloading audio or music files from the server and then playing them in your app. Anyways if you want to save the audio in your app , wouldn't it be better to download it and then play it ? Anyways please check these links



    How to download audio files from a server into my iPhone application?



    Download music file from server and save in my app



    Hope they help.






    share|improve this answer















    I think your issue would be similar to downloading audio or music files from the server and then playing them in your app. Anyways if you want to save the audio in your app , wouldn't it be better to download it and then play it ? Anyways please check these links



    How to download audio files from a server into my iPhone application?



    Download music file from server and save in my app



    Hope they help.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited May 23 '17 at 11:54









    Community

    11




    11










    answered Aug 20 '13 at 6:31









    IronManGillIronManGill

    7,13722349




    7,13722349












    • actually i want to play audio before it completely downloads, i want it to play as it download some part of audio file

      – Iqbal Khan
      Aug 20 '13 at 6:38











    • I have receive continue data from udp please suggest how can play continue like streaming

      – DURGESH Chaurasiya
      Jun 5 '17 at 11:57

















    • actually i want to play audio before it completely downloads, i want it to play as it download some part of audio file

      – Iqbal Khan
      Aug 20 '13 at 6:38











    • I have receive continue data from udp please suggest how can play continue like streaming

      – DURGESH Chaurasiya
      Jun 5 '17 at 11:57
















    actually i want to play audio before it completely downloads, i want it to play as it download some part of audio file

    – Iqbal Khan
    Aug 20 '13 at 6:38





    actually i want to play audio before it completely downloads, i want it to play as it download some part of audio file

    – Iqbal Khan
    Aug 20 '13 at 6:38













    I have receive continue data from udp please suggest how can play continue like streaming

    – DURGESH Chaurasiya
    Jun 5 '17 at 11:57





    I have receive continue data from udp please suggest how can play continue like streaming

    – DURGESH Chaurasiya
    Jun 5 '17 at 11:57













    38














    You could supply a resourceLoader delegate to take over control of the resource loading process from AVPlayer and then supply it the data as and when it requests and becomes available. The resource loader is a property on AVURLAsset. I've documented a full solution on my blog but the main idea is to switch the protocol of your URL to something custom so AVURLAsset's resource loader requires your application's assistance in loading that URL. Then when you get the AVAssetResourceLoaderDelegate callbacks, start downloading the file and try to respond to the pending requests received from those delegate callbacks as and when you have data. This will allow progressive loading/playback of the content without having to run a full blown HTTP server in your app or resorting to other complicated solutions.






    share|improve this answer

























    • Great answer! I was about to go down the route of setting up a local http server that would somewhat act as a proxy, but this solution seems way more elegant. Will definitely give it a try.

      – quentinadam
      Aug 28 '14 at 22:51






    • 1





      The code on your blog works like a charm!

      – quentinadam
      Aug 29 '14 at 10:12











    • Do you know which changes I have to make to get this working for video files? For some reason the player status changes to failure. I basically just inserted a video file instead of mp3 and added an avplayerlayer. The download starts and everything looks fine, but then the player's status changes from 0 (unknown) to 2 (failure)

      – Nils Ziehn
      Sep 9 '14 at 10:21











    • Nice! Have you run into the problem described here? We've got the same issue: stackoverflow.com/questions/29683567/…

      – Hudson
      Apr 17 '15 at 15:11






    • 2





      the code works great for audio, but not for video :(

      – joey
      Mar 29 '16 at 0:37















    38














    You could supply a resourceLoader delegate to take over control of the resource loading process from AVPlayer and then supply it the data as and when it requests and becomes available. The resource loader is a property on AVURLAsset. I've documented a full solution on my blog but the main idea is to switch the protocol of your URL to something custom so AVURLAsset's resource loader requires your application's assistance in loading that URL. Then when you get the AVAssetResourceLoaderDelegate callbacks, start downloading the file and try to respond to the pending requests received from those delegate callbacks as and when you have data. This will allow progressive loading/playback of the content without having to run a full blown HTTP server in your app or resorting to other complicated solutions.






    share|improve this answer

























    • Great answer! I was about to go down the route of setting up a local http server that would somewhat act as a proxy, but this solution seems way more elegant. Will definitely give it a try.

      – quentinadam
      Aug 28 '14 at 22:51






    • 1





      The code on your blog works like a charm!

      – quentinadam
      Aug 29 '14 at 10:12











    • Do you know which changes I have to make to get this working for video files? For some reason the player status changes to failure. I basically just inserted a video file instead of mp3 and added an avplayerlayer. The download starts and everything looks fine, but then the player's status changes from 0 (unknown) to 2 (failure)

      – Nils Ziehn
      Sep 9 '14 at 10:21











    • Nice! Have you run into the problem described here? We've got the same issue: stackoverflow.com/questions/29683567/…

      – Hudson
      Apr 17 '15 at 15:11






    • 2





      the code works great for audio, but not for video :(

      – joey
      Mar 29 '16 at 0:37













    38












    38








    38







    You could supply a resourceLoader delegate to take over control of the resource loading process from AVPlayer and then supply it the data as and when it requests and becomes available. The resource loader is a property on AVURLAsset. I've documented a full solution on my blog but the main idea is to switch the protocol of your URL to something custom so AVURLAsset's resource loader requires your application's assistance in loading that URL. Then when you get the AVAssetResourceLoaderDelegate callbacks, start downloading the file and try to respond to the pending requests received from those delegate callbacks as and when you have data. This will allow progressive loading/playback of the content without having to run a full blown HTTP server in your app or resorting to other complicated solutions.






    share|improve this answer















    You could supply a resourceLoader delegate to take over control of the resource loading process from AVPlayer and then supply it the data as and when it requests and becomes available. The resource loader is a property on AVURLAsset. I've documented a full solution on my blog but the main idea is to switch the protocol of your URL to something custom so AVURLAsset's resource loader requires your application's assistance in loading that URL. Then when you get the AVAssetResourceLoaderDelegate callbacks, start downloading the file and try to respond to the pending requests received from those delegate callbacks as and when you have data. This will allow progressive loading/playback of the content without having to run a full blown HTTP server in your app or resorting to other complicated solutions.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Mar 21 at 16:31









    kelin

    5,85653874




    5,85653874










    answered May 20 '14 at 8:46









    AnuragAnurag

    119k30199250




    119k30199250












    • Great answer! I was about to go down the route of setting up a local http server that would somewhat act as a proxy, but this solution seems way more elegant. Will definitely give it a try.

      – quentinadam
      Aug 28 '14 at 22:51






    • 1





      The code on your blog works like a charm!

      – quentinadam
      Aug 29 '14 at 10:12











    • Do you know which changes I have to make to get this working for video files? For some reason the player status changes to failure. I basically just inserted a video file instead of mp3 and added an avplayerlayer. The download starts and everything looks fine, but then the player's status changes from 0 (unknown) to 2 (failure)

      – Nils Ziehn
      Sep 9 '14 at 10:21











    • Nice! Have you run into the problem described here? We've got the same issue: stackoverflow.com/questions/29683567/…

      – Hudson
      Apr 17 '15 at 15:11






    • 2





      the code works great for audio, but not for video :(

      – joey
      Mar 29 '16 at 0:37

















    • Great answer! I was about to go down the route of setting up a local http server that would somewhat act as a proxy, but this solution seems way more elegant. Will definitely give it a try.

      – quentinadam
      Aug 28 '14 at 22:51






    • 1





      The code on your blog works like a charm!

      – quentinadam
      Aug 29 '14 at 10:12











    • Do you know which changes I have to make to get this working for video files? For some reason the player status changes to failure. I basically just inserted a video file instead of mp3 and added an avplayerlayer. The download starts and everything looks fine, but then the player's status changes from 0 (unknown) to 2 (failure)

      – Nils Ziehn
      Sep 9 '14 at 10:21











    • Nice! Have you run into the problem described here? We've got the same issue: stackoverflow.com/questions/29683567/…

      – Hudson
      Apr 17 '15 at 15:11






    • 2





      the code works great for audio, but not for video :(

      – joey
      Mar 29 '16 at 0:37
















    Great answer! I was about to go down the route of setting up a local http server that would somewhat act as a proxy, but this solution seems way more elegant. Will definitely give it a try.

    – quentinadam
    Aug 28 '14 at 22:51





    Great answer! I was about to go down the route of setting up a local http server that would somewhat act as a proxy, but this solution seems way more elegant. Will definitely give it a try.

    – quentinadam
    Aug 28 '14 at 22:51




    1




    1





    The code on your blog works like a charm!

    – quentinadam
    Aug 29 '14 at 10:12





    The code on your blog works like a charm!

    – quentinadam
    Aug 29 '14 at 10:12













    Do you know which changes I have to make to get this working for video files? For some reason the player status changes to failure. I basically just inserted a video file instead of mp3 and added an avplayerlayer. The download starts and everything looks fine, but then the player's status changes from 0 (unknown) to 2 (failure)

    – Nils Ziehn
    Sep 9 '14 at 10:21





    Do you know which changes I have to make to get this working for video files? For some reason the player status changes to failure. I basically just inserted a video file instead of mp3 and added an avplayerlayer. The download starts and everything looks fine, but then the player's status changes from 0 (unknown) to 2 (failure)

    – Nils Ziehn
    Sep 9 '14 at 10:21













    Nice! Have you run into the problem described here? We've got the same issue: stackoverflow.com/questions/29683567/…

    – Hudson
    Apr 17 '15 at 15:11





    Nice! Have you run into the problem described here? We've got the same issue: stackoverflow.com/questions/29683567/…

    – Hudson
    Apr 17 '15 at 15:11




    2




    2





    the code works great for audio, but not for video :(

    – joey
    Mar 29 '16 at 0:37





    the code works great for audio, but not for video :(

    – joey
    Mar 29 '16 at 0:37











    1














    Easy to do...using the same url for your audio stream use NSURLConnection to get the data and save using NSFilehandler...just done it myself whilst streaming audio and saving at the same time to mp3...let me know if you need code sample...






    share|improve this answer























    • yes,sure you can share the code for others, i had done that same thing that you just explain in the Answer and its working good.

      – Iqbal Khan
      Sep 11 '13 at 6:01











    • Can we please see a code sample of this? Maybe a gist on Github?

      – user3344977
      Apr 10 '15 at 6:32











    • Can we get this sample code pls?

      – inorganik
      Aug 21 '15 at 17:19











    • aren't you downloading the data twice by doing that? I wouldn't recommend

      – defense2000x
      Dec 5 '16 at 1:36
















    1














    Easy to do...using the same url for your audio stream use NSURLConnection to get the data and save using NSFilehandler...just done it myself whilst streaming audio and saving at the same time to mp3...let me know if you need code sample...






    share|improve this answer























    • yes,sure you can share the code for others, i had done that same thing that you just explain in the Answer and its working good.

      – Iqbal Khan
      Sep 11 '13 at 6:01











    • Can we please see a code sample of this? Maybe a gist on Github?

      – user3344977
      Apr 10 '15 at 6:32











    • Can we get this sample code pls?

      – inorganik
      Aug 21 '15 at 17:19











    • aren't you downloading the data twice by doing that? I wouldn't recommend

      – defense2000x
      Dec 5 '16 at 1:36














    1












    1








    1







    Easy to do...using the same url for your audio stream use NSURLConnection to get the data and save using NSFilehandler...just done it myself whilst streaming audio and saving at the same time to mp3...let me know if you need code sample...






    share|improve this answer













    Easy to do...using the same url for your audio stream use NSURLConnection to get the data and save using NSFilehandler...just done it myself whilst streaming audio and saving at the same time to mp3...let me know if you need code sample...







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Sep 10 '13 at 22:17









    Alex McPhersonAlex McPherson

    1,93231934




    1,93231934












    • yes,sure you can share the code for others, i had done that same thing that you just explain in the Answer and its working good.

      – Iqbal Khan
      Sep 11 '13 at 6:01











    • Can we please see a code sample of this? Maybe a gist on Github?

      – user3344977
      Apr 10 '15 at 6:32











    • Can we get this sample code pls?

      – inorganik
      Aug 21 '15 at 17:19











    • aren't you downloading the data twice by doing that? I wouldn't recommend

      – defense2000x
      Dec 5 '16 at 1:36


















    • yes,sure you can share the code for others, i had done that same thing that you just explain in the Answer and its working good.

      – Iqbal Khan
      Sep 11 '13 at 6:01











    • Can we please see a code sample of this? Maybe a gist on Github?

      – user3344977
      Apr 10 '15 at 6:32











    • Can we get this sample code pls?

      – inorganik
      Aug 21 '15 at 17:19











    • aren't you downloading the data twice by doing that? I wouldn't recommend

      – defense2000x
      Dec 5 '16 at 1:36

















    yes,sure you can share the code for others, i had done that same thing that you just explain in the Answer and its working good.

    – Iqbal Khan
    Sep 11 '13 at 6:01





    yes,sure you can share the code for others, i had done that same thing that you just explain in the Answer and its working good.

    – Iqbal Khan
    Sep 11 '13 at 6:01













    Can we please see a code sample of this? Maybe a gist on Github?

    – user3344977
    Apr 10 '15 at 6:32





    Can we please see a code sample of this? Maybe a gist on Github?

    – user3344977
    Apr 10 '15 at 6:32













    Can we get this sample code pls?

    – inorganik
    Aug 21 '15 at 17:19





    Can we get this sample code pls?

    – inorganik
    Aug 21 '15 at 17:19













    aren't you downloading the data twice by doing that? I wouldn't recommend

    – defense2000x
    Dec 5 '16 at 1:36






    aren't you downloading the data twice by doing that? I wouldn't recommend

    – defense2000x
    Dec 5 '16 at 1:36












    1














    The team at Calm has open-sourced our implementation to this. It's available as a CocoaPod. It's called PersistentStreamPlayer.



    It acts as a resourceLoader. The big benefit over other implementations is that it does not require the binary data to be in memory at any point, so it supports larger files.



    Features include:



    • streaming of audio file, starting playback as soon as first data is available

    • also saves streamed data to a file URL as soon as the buffer completes
      exposes timeBuffered, helpful for displaying buffer progress bars in the UI

    • handles re-starting the audio file after the buffer stream stalls (e.g. slow network)

    • simple play, pause and destroy methods (destroy clears all memory resources)

    • does not keep audio file data in memory, so that it supports large files that don't fit in RAM

    You can find it here: https://github.com/calmcom/PersistentStreamPlayer






    share|improve this answer























    • it mentions "Stream audio over http, and persist the data to a local file while buffering" does it work for video aswell ?

      – Bonnie
      Oct 25 '17 at 19:44















    1














    The team at Calm has open-sourced our implementation to this. It's available as a CocoaPod. It's called PersistentStreamPlayer.



    It acts as a resourceLoader. The big benefit over other implementations is that it does not require the binary data to be in memory at any point, so it supports larger files.



    Features include:



    • streaming of audio file, starting playback as soon as first data is available

    • also saves streamed data to a file URL as soon as the buffer completes
      exposes timeBuffered, helpful for displaying buffer progress bars in the UI

    • handles re-starting the audio file after the buffer stream stalls (e.g. slow network)

    • simple play, pause and destroy methods (destroy clears all memory resources)

    • does not keep audio file data in memory, so that it supports large files that don't fit in RAM

    You can find it here: https://github.com/calmcom/PersistentStreamPlayer






    share|improve this answer























    • it mentions "Stream audio over http, and persist the data to a local file while buffering" does it work for video aswell ?

      – Bonnie
      Oct 25 '17 at 19:44













    1












    1








    1







    The team at Calm has open-sourced our implementation to this. It's available as a CocoaPod. It's called PersistentStreamPlayer.



    It acts as a resourceLoader. The big benefit over other implementations is that it does not require the binary data to be in memory at any point, so it supports larger files.



    Features include:



    • streaming of audio file, starting playback as soon as first data is available

    • also saves streamed data to a file URL as soon as the buffer completes
      exposes timeBuffered, helpful for displaying buffer progress bars in the UI

    • handles re-starting the audio file after the buffer stream stalls (e.g. slow network)

    • simple play, pause and destroy methods (destroy clears all memory resources)

    • does not keep audio file data in memory, so that it supports large files that don't fit in RAM

    You can find it here: https://github.com/calmcom/PersistentStreamPlayer






    share|improve this answer













    The team at Calm has open-sourced our implementation to this. It's available as a CocoaPod. It's called PersistentStreamPlayer.



    It acts as a resourceLoader. The big benefit over other implementations is that it does not require the binary data to be in memory at any point, so it supports larger files.



    Features include:



    • streaming of audio file, starting playback as soon as first data is available

    • also saves streamed data to a file URL as soon as the buffer completes
      exposes timeBuffered, helpful for displaying buffer progress bars in the UI

    • handles re-starting the audio file after the buffer stream stalls (e.g. slow network)

    • simple play, pause and destroy methods (destroy clears all memory resources)

    • does not keep audio file data in memory, so that it supports large files that don't fit in RAM

    You can find it here: https://github.com/calmcom/PersistentStreamPlayer







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Oct 7 '16 at 22:00









    Tyler SheafferTyler Sheaffer

    1,0611815




    1,0611815












    • it mentions "Stream audio over http, and persist the data to a local file while buffering" does it work for video aswell ?

      – Bonnie
      Oct 25 '17 at 19:44

















    • it mentions "Stream audio over http, and persist the data to a local file while buffering" does it work for video aswell ?

      – Bonnie
      Oct 25 '17 at 19:44
















    it mentions "Stream audio over http, and persist the data to a local file while buffering" does it work for video aswell ?

    – Bonnie
    Oct 25 '17 at 19:44





    it mentions "Stream audio over http, and persist the data to a local file while buffering" does it work for video aswell ?

    – Bonnie
    Oct 25 '17 at 19:44











    0














    You can't access the buffer of the AVPlayer. Some hints: You can put previews (short versions of audios) of your audio files on your server, so that Your users could listen the previews before they download the full audio files, or you may search for custom open source audio stream players, maybe those will allow you to access the stream buffer. Good Luck!






    share|improve this answer



























      0














      You can't access the buffer of the AVPlayer. Some hints: You can put previews (short versions of audios) of your audio files on your server, so that Your users could listen the previews before they download the full audio files, or you may search for custom open source audio stream players, maybe those will allow you to access the stream buffer. Good Luck!






      share|improve this answer

























        0












        0








        0







        You can't access the buffer of the AVPlayer. Some hints: You can put previews (short versions of audios) of your audio files on your server, so that Your users could listen the previews before they download the full audio files, or you may search for custom open source audio stream players, maybe those will allow you to access the stream buffer. Good Luck!






        share|improve this answer













        You can't access the buffer of the AVPlayer. Some hints: You can put previews (short versions of audios) of your audio files on your server, so that Your users could listen the previews before they download the full audio files, or you may search for custom open source audio stream players, maybe those will allow you to access the stream buffer. Good Luck!







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 20 '13 at 6:59









        Fahri AzimovFahri Azimov

        8,19411729




        8,19411729



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f18327920%2fsaving-buffer-data-of-avplayer%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

            155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해