AVPlayer not able to playing Live Radio URL












2














My Live Radio URL is http://s2.yesstreaming.net:7091/stream and AVPlayer not able to play.



It's Live Radio Audio.



And it's my code.



@interface ViewController () {
AVPlayer *player;
}

@end

@implementation ViewController

- (void)viewDidLoad {
[super viewDidLoad];

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
[[AVAudioSession sharedInstance] setActive:true error:nil];
// Do any additional setup after loading the view, typically from a nib.
player = [[AVPlayer alloc] init];
}

-(void)viewDidAppear:(BOOL)animated {
AVPlayer *player123 = [[AVPlayer alloc]initWithURL:[NSURL URLWithString:@"http://s2.yesstreaming.net:7091/stream"]];
player.allowsExternalPlayback = true;
player = player123;
}

- (IBAction)btnPayPauseAction:(UIButton *)sender {
sender.selected = !sender.selected;
if (sender.selected) {
[player play];
} else {
[player pause];
}
}
@end


The error is :



Task <70641693-CCCD-43C1-8A18-13A853FA3CD3>.<1> load failed with error Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=http://s2.yesstreaming.net:7091/stream, NSErrorFailingURLKey=http://s2.yesstreaming.net:7091/stream, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <70641693-CCCD-43C1-8A18-13A853FA3CD3>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <70641693-CCCD-43C1-8A18-13A853FA3CD3>.<1>, NSLocalizedDescription=cancelled} [-999]









share|improve this question
























  • Possible duplicate of Access the data of AVPlayer when playing video from HTTP Live Streaming
    – impression7vx
    Nov 16 at 5:21










  • It's not duplicate of this. And also not saved it on locally.
    – Jaydip Godhani
    Nov 16 at 5:29










  • Maybe it is; maybe it is not. I can't tell what you are doing or attempting as the code is not here to see. Very difficult to provide answers if you don't provide information.
    – impression7vx
    Nov 16 at 5:34










  • @impression7vx sir, it's my code.
    – Jaydip Godhani
    Nov 16 at 5:42










  • Where do you declare your player object? Inside a function or inside a class? Which scope?
    – impression7vx
    Nov 16 at 5:52
















2














My Live Radio URL is http://s2.yesstreaming.net:7091/stream and AVPlayer not able to play.



It's Live Radio Audio.



And it's my code.



@interface ViewController () {
AVPlayer *player;
}

@end

@implementation ViewController

- (void)viewDidLoad {
[super viewDidLoad];

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
[[AVAudioSession sharedInstance] setActive:true error:nil];
// Do any additional setup after loading the view, typically from a nib.
player = [[AVPlayer alloc] init];
}

-(void)viewDidAppear:(BOOL)animated {
AVPlayer *player123 = [[AVPlayer alloc]initWithURL:[NSURL URLWithString:@"http://s2.yesstreaming.net:7091/stream"]];
player.allowsExternalPlayback = true;
player = player123;
}

- (IBAction)btnPayPauseAction:(UIButton *)sender {
sender.selected = !sender.selected;
if (sender.selected) {
[player play];
} else {
[player pause];
}
}
@end


The error is :



Task <70641693-CCCD-43C1-8A18-13A853FA3CD3>.<1> load failed with error Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=http://s2.yesstreaming.net:7091/stream, NSErrorFailingURLKey=http://s2.yesstreaming.net:7091/stream, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <70641693-CCCD-43C1-8A18-13A853FA3CD3>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <70641693-CCCD-43C1-8A18-13A853FA3CD3>.<1>, NSLocalizedDescription=cancelled} [-999]









share|improve this question
























  • Possible duplicate of Access the data of AVPlayer when playing video from HTTP Live Streaming
    – impression7vx
    Nov 16 at 5:21










  • It's not duplicate of this. And also not saved it on locally.
    – Jaydip Godhani
    Nov 16 at 5:29










  • Maybe it is; maybe it is not. I can't tell what you are doing or attempting as the code is not here to see. Very difficult to provide answers if you don't provide information.
    – impression7vx
    Nov 16 at 5:34










  • @impression7vx sir, it's my code.
    – Jaydip Godhani
    Nov 16 at 5:42










  • Where do you declare your player object? Inside a function or inside a class? Which scope?
    – impression7vx
    Nov 16 at 5:52














2












2








2







My Live Radio URL is http://s2.yesstreaming.net:7091/stream and AVPlayer not able to play.



It's Live Radio Audio.



And it's my code.



@interface ViewController () {
AVPlayer *player;
}

@end

@implementation ViewController

- (void)viewDidLoad {
[super viewDidLoad];

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
[[AVAudioSession sharedInstance] setActive:true error:nil];
// Do any additional setup after loading the view, typically from a nib.
player = [[AVPlayer alloc] init];
}

-(void)viewDidAppear:(BOOL)animated {
AVPlayer *player123 = [[AVPlayer alloc]initWithURL:[NSURL URLWithString:@"http://s2.yesstreaming.net:7091/stream"]];
player.allowsExternalPlayback = true;
player = player123;
}

- (IBAction)btnPayPauseAction:(UIButton *)sender {
sender.selected = !sender.selected;
if (sender.selected) {
[player play];
} else {
[player pause];
}
}
@end


The error is :



Task <70641693-CCCD-43C1-8A18-13A853FA3CD3>.<1> load failed with error Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=http://s2.yesstreaming.net:7091/stream, NSErrorFailingURLKey=http://s2.yesstreaming.net:7091/stream, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <70641693-CCCD-43C1-8A18-13A853FA3CD3>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <70641693-CCCD-43C1-8A18-13A853FA3CD3>.<1>, NSLocalizedDescription=cancelled} [-999]









share|improve this question















My Live Radio URL is http://s2.yesstreaming.net:7091/stream and AVPlayer not able to play.



It's Live Radio Audio.



And it's my code.



@interface ViewController () {
AVPlayer *player;
}

@end

@implementation ViewController

- (void)viewDidLoad {
[super viewDidLoad];

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
[[AVAudioSession sharedInstance] setActive:true error:nil];
// Do any additional setup after loading the view, typically from a nib.
player = [[AVPlayer alloc] init];
}

-(void)viewDidAppear:(BOOL)animated {
AVPlayer *player123 = [[AVPlayer alloc]initWithURL:[NSURL URLWithString:@"http://s2.yesstreaming.net:7091/stream"]];
player.allowsExternalPlayback = true;
player = player123;
}

- (IBAction)btnPayPauseAction:(UIButton *)sender {
sender.selected = !sender.selected;
if (sender.selected) {
[player play];
} else {
[player pause];
}
}
@end


The error is :



Task <70641693-CCCD-43C1-8A18-13A853FA3CD3>.<1> load failed with error Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=http://s2.yesstreaming.net:7091/stream, NSErrorFailingURLKey=http://s2.yesstreaming.net:7091/stream, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <70641693-CCCD-43C1-8A18-13A853FA3CD3>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <70641693-CCCD-43C1-8A18-13A853FA3CD3>.<1>, NSLocalizedDescription=cancelled} [-999]






ios avplayer






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 16 at 5:58

























asked Nov 16 at 5:20









Jaydip Godhani

959




959












  • Possible duplicate of Access the data of AVPlayer when playing video from HTTP Live Streaming
    – impression7vx
    Nov 16 at 5:21










  • It's not duplicate of this. And also not saved it on locally.
    – Jaydip Godhani
    Nov 16 at 5:29










  • Maybe it is; maybe it is not. I can't tell what you are doing or attempting as the code is not here to see. Very difficult to provide answers if you don't provide information.
    – impression7vx
    Nov 16 at 5:34










  • @impression7vx sir, it's my code.
    – Jaydip Godhani
    Nov 16 at 5:42










  • Where do you declare your player object? Inside a function or inside a class? Which scope?
    – impression7vx
    Nov 16 at 5:52


















  • Possible duplicate of Access the data of AVPlayer when playing video from HTTP Live Streaming
    – impression7vx
    Nov 16 at 5:21










  • It's not duplicate of this. And also not saved it on locally.
    – Jaydip Godhani
    Nov 16 at 5:29










  • Maybe it is; maybe it is not. I can't tell what you are doing or attempting as the code is not here to see. Very difficult to provide answers if you don't provide information.
    – impression7vx
    Nov 16 at 5:34










  • @impression7vx sir, it's my code.
    – Jaydip Godhani
    Nov 16 at 5:42










  • Where do you declare your player object? Inside a function or inside a class? Which scope?
    – impression7vx
    Nov 16 at 5:52
















Possible duplicate of Access the data of AVPlayer when playing video from HTTP Live Streaming
– impression7vx
Nov 16 at 5:21




Possible duplicate of Access the data of AVPlayer when playing video from HTTP Live Streaming
– impression7vx
Nov 16 at 5:21












It's not duplicate of this. And also not saved it on locally.
– Jaydip Godhani
Nov 16 at 5:29




It's not duplicate of this. And also not saved it on locally.
– Jaydip Godhani
Nov 16 at 5:29












Maybe it is; maybe it is not. I can't tell what you are doing or attempting as the code is not here to see. Very difficult to provide answers if you don't provide information.
– impression7vx
Nov 16 at 5:34




Maybe it is; maybe it is not. I can't tell what you are doing or attempting as the code is not here to see. Very difficult to provide answers if you don't provide information.
– impression7vx
Nov 16 at 5:34












@impression7vx sir, it's my code.
– Jaydip Godhani
Nov 16 at 5:42




@impression7vx sir, it's my code.
– Jaydip Godhani
Nov 16 at 5:42












Where do you declare your player object? Inside a function or inside a class? Which scope?
– impression7vx
Nov 16 at 5:52




Where do you declare your player object? Inside a function or inside a class? Which scope?
– impression7vx
Nov 16 at 5:52

















active

oldest

votes











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%2f53331873%2favplayer-not-able-to-playing-live-radio-url%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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%2f53331873%2favplayer-not-able-to-playing-live-radio-url%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

How to change which sound is reproduced for terminal bell?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Can I use Tabulator js library in my java Spring + Thymeleaf project?