noppefoxwolf / TwitterVideoUploader

MIT License
3 stars 0 forks source link

How to make video upload running while app is background #3

Open ghost opened 6 years ago

ghost commented 6 years ago

Hi author,

Recently, I have an issue of using your uploader, that is, video upload makes no progress while app is background (e.g. launch your example project, and then run other app to turn former to be background), only it's switched to foreground, progress will be seen.

If timeout is not set, switching to foreground after it's in background for long time will lead to request time out failure. As a result, I set the timeout as

, then upload just makes no progress.

Would you give me suggestion to make upload work even if the app in background? Thanks a lot!!!

  1. Xcode console output when it's in background: ---- Video Track Infomation --- File Path: file:///var/containers/Bundle/Application/ADB996BD-62FD-4726-A361-B362D13A7B7E/TwitterVideoUploader_Example.app/sample.mp4 Duration: 60.7333333333333sec File Size: 4.68279MB (4910263B) Dimension: 268.0 x 480.0 [width x height] Aspect Ratio: 0.558333 Channel Count: 2 FPS: 30.0

valid! 2017-11-28 12:29:15.090489-0800 TwitterVideoUploader_Example[61659:6660931] -- <__NSObserver: 0x1c4241a40> 2017-11-28 12:29:15.139262-0800 TwitterVideoUploader_Example[61659:6660931] refreshPreferences: HangTracerEnabled: 0 2017-11-28 12:29:15.139355-0800 TwitterVideoUploader_Example[61659:6660931] refreshPreferences: HangTracerDuration: 500 2017-11-28 12:29:15.139369-0800 TwitterVideoUploader_Example[61659:6660931] refreshPreferences: ActivationLoggingEnabled: 0 ActivationLoggingTaskedOffByDA:0 935606535606038528 86400 2017-11-28 12:29:17.060221-0800 TwitterVideoUploader_Example[61659:6661005] TIC Read Status [1:0x0]: 1:57 2017-11-28 12:29:17.060663-0800 TwitterVideoUploader_Example[61659:6661005] TIC Read Status [1:0x0]: 1:57

  1. output when it's in foreground 2017-11-28 12:32:56.907995-0800 TwitterVideoUploader_Example[61659:6661008] [] nw_socket_get_input_frames recvmsg(fd 7, 1024 bytes): [57] Socket is not connected 2017-11-28 12:32:56.910830-0800 TwitterVideoUploader_Example[61659:6661008] TIC Read Status [2:0x1c416abc0]: 1:57 2017-11-28 12:32:56.910865-0800 TwitterVideoUploader_Example[61659:6661008] TIC Read Status [2:0x1c416abc0]: 1:57 2017-11-28 12:33:23.084984-0800 TwitterVideoUploader_Example[61659:6663138] finished 2017-11-28 12:33:23.089919-0800 TwitterVideoUploader_Example[61659:6663137] TIC Read Status [3:0x0]: 1:57 2017-11-28 12:33:23.090031-0800 TwitterVideoUploader_Example[61659:6663137] TIC Read Status [3:0x0]: 1:57 2017-11-28 12:33:23.507977-0800 TwitterVideoUploader_Example[61659:6663359] TIC Read Status [4:0x0]: 1:57 2017-11-28 12:33:23.508159-0800 TwitterVideoUploader_Example[61659:6663359] TIC Read Status [4:0x0]: 1:57 2017-11-28 12:33:24.377005-0800 TwitterVideoUploader_Example[61659:6663359] TIC Read Status [5:0x0]: 1:57 2017-11-28 12:33:24.377109-0800 TwitterVideoUploader_Example[61659:6663359] TIC Read Status [5:0x0]: 1:57 2017-11-28 12:33:29.702149-0800 TwitterVideoUploader_Example[61659:6661008] TIC Read Status [6:0x0]: 1:57 2017-11-28 12:33:29.702206-0800 TwitterVideoUploader_Example[61659:6661008] TIC Read Status [6:0x0]: 1:57 complete dispose 2017-11-28 12:33:30.599126-0800 TwitterVideoUploader_Example[61659:6663359] TIC Read Status [7:0x0]: 1:57 2017-11-28 12:33:30.599269-0800 TwitterVideoUploader_Example[61659:6663359] TIC Read Status [7:0x0]: 1:57