小编Rob*_*raz的帖子

如何在后端获取HTTP请求的用户所在国家/地区?

我试图让用户将请求发送到我的服务器的国家/地区.

到目前为止,我找到了这些解决方案

https://github.com/fiorix/freegeoip

https://github.com/maxmind/GeoIP2-java

这些解决方案正在使用具有许可证的MaxMind数据库GeoIP2国家数据库,对于这个特定项目,我对图书馆有限制(由于业务的法律方面)

我发现一些主题提到Google API可以提供此服务,但这并不让我感兴趣,因为我想要一个我可以自己托管的解决方案,它是使用Java或Kotlin实现的.

有人知道一个与上面提到的解决方案不同的解决方案(在后端运行)吗?

java spring backend kotlin

13
推荐指数
1
解决办法
1233
查看次数

AVPlayer没有完成流跟踪

我正在使用AVPlayer播放长音频mp3流音乐(8分钟),短音乐(1到3分钟)播放完美,但随着这些更大的音乐,音乐开始播放,但播放后的一些随机时间(2至3:20之间) )玩家从头开始再次启动赛道.虽然播放器重启音乐,但状态信息(持续时间和当前时间)保持正常计数,无需重启,只需重启音频.有人有想法吗?

我正在播放的文件是:http://storage-new.newjamendo.com/download/track/57864/mp​​31/

玩家代码:

AVAudioSession *mySession = [AVAudioSession sharedInstance];

// Assign the Playback category to the audio session.
NSError *audioSessionError = nil;
[mySession setCategory: AVAudioSessionCategoryPlayback
                 error: &audioSessionError];

if (audioSessionError != nil) {

    NSLog (@"Error setting audio session category.");
    return;
}

// Activate the audio session
[mySession setActive: YES
               error: &audioSessionError];

if (audioSessionError != nil) {

    NSLog (@"Error activating audio session during initial setup.");
    return;
}

player = [AVPlayer playerWithURL:[NSURL URLWithString:url]];


[player play];
Run Code Online (Sandbox Code Playgroud)

以下是我如何跟踪有关正常计数的当前时间的信息.

AVPlayerItem *item = player.currentItem; …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c audio-streaming avplayer ios7

6
推荐指数
1
解决办法
922
查看次数

标签 统计

audio-streaming ×1

avplayer ×1

backend ×1

ios7 ×1

iphone ×1

java ×1

kotlin ×1

objective-c ×1

spring ×1