-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong pre-loaded time for youtube audio 140 #99
Comments
Where did you get pre-loaded time? from delegate method? More detail required |
Yes, that delegate. Playing audio code: |
I found that hysteriaPlayerCurrentItemPreloaded get called 2 times when using the youtube link decoded. While with another service, only 1 time. That causes the problem. |
I believe this problem is with how AVPlayer works. If you try to paste the URL in your safari and run also you will get same calculation. If you are playing a youtube audio, I would suggest to listen for playing time and when its half of the total time, move to next song programatically. |
@han9over : yes, so far I had to make a timer to compare and decide when should the video stopped. But think it's a litte bit hacking. |
@han9over Just tested this and i'm getting the same output, incorrect duration being reported by the player, opening the link in Chrome reports the correct duration where as the player doubles it, mp4 issue doubling the of the content size means incorrect reporting of player time. |
Also @gloryluu if you could share your calculation logic to compare it against my own solution to skip to the next track for efficiency it would be greatly appreciated 👍 |
In |
You will also need a timer running a scheduled update to check which checks if the progress is duration - 0.5 in order to stop the audio and call the delegate you use to inform the UI as much. Note that this timer should be run every 0.4 seconds and preferably on a GCD thread (In order to ensure you can catch the progress at dur - 0.5 |
I extracted the audio link and get the wrong pre-loaded time. For example: this video's duration is 201s but I get 401s. How to fix that?
https://r8---sn-42u-i5ok.googlevideo.com/videoplayback?initcwndbps=2048750&dur=200.782&mime=audio%2Fmp4&sver=3&expire=1449095491&ipbits=0&mm=31&mn=sn-42u-i5ok&id=o-AHU7uLn9c8Pgo2DtWSLtAmq1HNZoH8uF-QZaTZZiLRgs&mv=m&pl=26&mt=1449073742&gir=yes&fexp=9408710%2C9416074%2C9416126%2C9417580%2C9417683%2C9418200%2C9418866%2C9420310%2C9420452%2C9421166%2C9421941%2C9421977%2C9422596%2C9422618%2C9423299%2C9423662%2C9424055%2C9424220%2C9424644%2C9424845%2C9424963&ms=au&ip=210.245.14.70&requiressl=yes&upn=mqC-Rjp5OUk&key=yt6&lmt=1394256224083111&keepalive=yes&itag=140&sparams=clen%2Cdur%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cupn%2Cexpire&source=youtube&clen=3189562&signature=29CD06041A0E06CCC6DD587A24F4244BFE3C6C11.344FF7DDBA986CA33144B8478412B4A89F6A5F9A
The text was updated successfully, but these errors were encountered: