YTPlayerView does not play Content on Simulator (Decoding failed with error code)











up vote
0
down vote

favorite












When I play a normal content, it loads perfectly fine on
the simulator.



YTPlayerView parameters



@implementation SingleVideoViewController

- (void)viewDidLoad {
[super viewDidLoad];
NSString *videoId = @"weRHyjj34ZE";

// For a full list of player parameters, see the documentation for the HTML5 player
// at: https://developers.google.com/youtube/player_parameters?playerVersion=HTML5
NSDictionary *playerVars = @{
@"controls" : @0,
@"playsinline" : @1,
@"autohide" : @1,
@"showinfo" : @0,
@"modestbranding" : @1
};
self.playerView.delegate = self;
[self.playerView loadWithVideoId:videoId playerVars:playerVars];



[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(receivedPlaybackStartedNotification:)
name:@"Playback started"
object:nil];

}


But, If I have a HD Video in my playlist it gives below error and the code https://github.com/youtube/youtube-ios-player-helper



Code is available with the Git Project, just download it and change the videoId in the SingleVideoViewController.



Decoding failed with error code -1
Decoding: C0 0x01E00168 0x0000304A 0x22111100 0x00000000 6668
Options: 1x-1 [0000002D,01E0010F] 0001C060
Decoding failed with error code 7
Decoding: C0 0x01E00168 0x0000304A 0x22111100 0x00000000 773
Options: 1x-1 [0000002D,01E0010F] 0001C060
Decoding failed with error code -1
Decoding: C0 0x01E00168 0x0000304A 0x22111100 0x00000000 773
Options: 480x360 [FFFFFFFF,FFFFFFFF] 0001C060









share|improve this question
























  • What is the url that you are playing? It might be corrupt.
    – PGDev
    Nov 22 at 16:38












  • I have a play list which I am trying to play. One video I have uploaded which works fine, other one I added from the YOU TUBE Video id weRHyjj34ZE
    – andyPaul
    Nov 22 at 16:46












  • Show the code that you have used to configure the player.
    – PGDev
    Nov 22 at 16:47










  • I have not written a new code, project example is available on GitHub , in SingleViewController just change the video id.
    – andyPaul
    Nov 22 at 16:58










  • Added the answer. You can have a look.
    – PGDev
    Nov 22 at 17:15















up vote
0
down vote

favorite












When I play a normal content, it loads perfectly fine on
the simulator.



YTPlayerView parameters



@implementation SingleVideoViewController

- (void)viewDidLoad {
[super viewDidLoad];
NSString *videoId = @"weRHyjj34ZE";

// For a full list of player parameters, see the documentation for the HTML5 player
// at: https://developers.google.com/youtube/player_parameters?playerVersion=HTML5
NSDictionary *playerVars = @{
@"controls" : @0,
@"playsinline" : @1,
@"autohide" : @1,
@"showinfo" : @0,
@"modestbranding" : @1
};
self.playerView.delegate = self;
[self.playerView loadWithVideoId:videoId playerVars:playerVars];



[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(receivedPlaybackStartedNotification:)
name:@"Playback started"
object:nil];

}


But, If I have a HD Video in my playlist it gives below error and the code https://github.com/youtube/youtube-ios-player-helper



Code is available with the Git Project, just download it and change the videoId in the SingleVideoViewController.



Decoding failed with error code -1
Decoding: C0 0x01E00168 0x0000304A 0x22111100 0x00000000 6668
Options: 1x-1 [0000002D,01E0010F] 0001C060
Decoding failed with error code 7
Decoding: C0 0x01E00168 0x0000304A 0x22111100 0x00000000 773
Options: 1x-1 [0000002D,01E0010F] 0001C060
Decoding failed with error code -1
Decoding: C0 0x01E00168 0x0000304A 0x22111100 0x00000000 773
Options: 480x360 [FFFFFFFF,FFFFFFFF] 0001C060









share|improve this question
























  • What is the url that you are playing? It might be corrupt.
    – PGDev
    Nov 22 at 16:38












  • I have a play list which I am trying to play. One video I have uploaded which works fine, other one I added from the YOU TUBE Video id weRHyjj34ZE
    – andyPaul
    Nov 22 at 16:46












  • Show the code that you have used to configure the player.
    – PGDev
    Nov 22 at 16:47










  • I have not written a new code, project example is available on GitHub , in SingleViewController just change the video id.
    – andyPaul
    Nov 22 at 16:58










  • Added the answer. You can have a look.
    – PGDev
    Nov 22 at 17:15













up vote
0
down vote

favorite









up vote
0
down vote

favorite











When I play a normal content, it loads perfectly fine on
the simulator.



YTPlayerView parameters



@implementation SingleVideoViewController

- (void)viewDidLoad {
[super viewDidLoad];
NSString *videoId = @"weRHyjj34ZE";

// For a full list of player parameters, see the documentation for the HTML5 player
// at: https://developers.google.com/youtube/player_parameters?playerVersion=HTML5
NSDictionary *playerVars = @{
@"controls" : @0,
@"playsinline" : @1,
@"autohide" : @1,
@"showinfo" : @0,
@"modestbranding" : @1
};
self.playerView.delegate = self;
[self.playerView loadWithVideoId:videoId playerVars:playerVars];



[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(receivedPlaybackStartedNotification:)
name:@"Playback started"
object:nil];

}


But, If I have a HD Video in my playlist it gives below error and the code https://github.com/youtube/youtube-ios-player-helper



Code is available with the Git Project, just download it and change the videoId in the SingleVideoViewController.



Decoding failed with error code -1
Decoding: C0 0x01E00168 0x0000304A 0x22111100 0x00000000 6668
Options: 1x-1 [0000002D,01E0010F] 0001C060
Decoding failed with error code 7
Decoding: C0 0x01E00168 0x0000304A 0x22111100 0x00000000 773
Options: 1x-1 [0000002D,01E0010F] 0001C060
Decoding failed with error code -1
Decoding: C0 0x01E00168 0x0000304A 0x22111100 0x00000000 773
Options: 480x360 [FFFFFFFF,FFFFFFFF] 0001C060









share|improve this question















When I play a normal content, it loads perfectly fine on
the simulator.



YTPlayerView parameters



@implementation SingleVideoViewController

- (void)viewDidLoad {
[super viewDidLoad];
NSString *videoId = @"weRHyjj34ZE";

// For a full list of player parameters, see the documentation for the HTML5 player
// at: https://developers.google.com/youtube/player_parameters?playerVersion=HTML5
NSDictionary *playerVars = @{
@"controls" : @0,
@"playsinline" : @1,
@"autohide" : @1,
@"showinfo" : @0,
@"modestbranding" : @1
};
self.playerView.delegate = self;
[self.playerView loadWithVideoId:videoId playerVars:playerVars];



[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(receivedPlaybackStartedNotification:)
name:@"Playback started"
object:nil];

}


But, If I have a HD Video in my playlist it gives below error and the code https://github.com/youtube/youtube-ios-player-helper



Code is available with the Git Project, just download it and change the videoId in the SingleVideoViewController.



Decoding failed with error code -1
Decoding: C0 0x01E00168 0x0000304A 0x22111100 0x00000000 6668
Options: 1x-1 [0000002D,01E0010F] 0001C060
Decoding failed with error code 7
Decoding: C0 0x01E00168 0x0000304A 0x22111100 0x00000000 773
Options: 1x-1 [0000002D,01E0010F] 0001C060
Decoding failed with error code -1
Decoding: C0 0x01E00168 0x0000304A 0x22111100 0x00000000 773
Options: 480x360 [FFFFFFFF,FFFFFFFF] 0001C060






ios objective-c youtube-api ios-simulator






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 at 23:25

























asked Nov 22 at 16:21









andyPaul

1,65052864




1,65052864












  • What is the url that you are playing? It might be corrupt.
    – PGDev
    Nov 22 at 16:38












  • I have a play list which I am trying to play. One video I have uploaded which works fine, other one I added from the YOU TUBE Video id weRHyjj34ZE
    – andyPaul
    Nov 22 at 16:46












  • Show the code that you have used to configure the player.
    – PGDev
    Nov 22 at 16:47










  • I have not written a new code, project example is available on GitHub , in SingleViewController just change the video id.
    – andyPaul
    Nov 22 at 16:58










  • Added the answer. You can have a look.
    – PGDev
    Nov 22 at 17:15


















  • What is the url that you are playing? It might be corrupt.
    – PGDev
    Nov 22 at 16:38












  • I have a play list which I am trying to play. One video I have uploaded which works fine, other one I added from the YOU TUBE Video id weRHyjj34ZE
    – andyPaul
    Nov 22 at 16:46












  • Show the code that you have used to configure the player.
    – PGDev
    Nov 22 at 16:47










  • I have not written a new code, project example is available on GitHub , in SingleViewController just change the video id.
    – andyPaul
    Nov 22 at 16:58










  • Added the answer. You can have a look.
    – PGDev
    Nov 22 at 17:15
















What is the url that you are playing? It might be corrupt.
– PGDev
Nov 22 at 16:38






What is the url that you are playing? It might be corrupt.
– PGDev
Nov 22 at 16:38














I have a play list which I am trying to play. One video I have uploaded which works fine, other one I added from the YOU TUBE Video id weRHyjj34ZE
– andyPaul
Nov 22 at 16:46






I have a play list which I am trying to play. One video I have uploaded which works fine, other one I added from the YOU TUBE Video id weRHyjj34ZE
– andyPaul
Nov 22 at 16:46














Show the code that you have used to configure the player.
– PGDev
Nov 22 at 16:47




Show the code that you have used to configure the player.
– PGDev
Nov 22 at 16:47












I have not written a new code, project example is available on GitHub , in SingleViewController just change the video id.
– andyPaul
Nov 22 at 16:58




I have not written a new code, project example is available on GitHub , in SingleViewController just change the video id.
– andyPaul
Nov 22 at 16:58












Added the answer. You can have a look.
– PGDev
Nov 22 at 17:15




Added the answer. You can have a look.
– PGDev
Nov 22 at 17:15












1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










Try adding origin parameter to your playerVars dictionary, i.e



NSDictionary *playerVars = @{
@"controls" : @0,
@"playsinline" : @1,
@"autohide" : @1,
@"showinfo" : @0,
@"modestbranding" : @1,
@"origin":@"https://www.youtube.com"
};


From YouTube API docs,




Origin: This parameter provides an extra security measure for the IFrame API and is only supported for IFrame embeds. If you are using
the IFrame API, which means you are setting the enablejsapi parameter
value to 1, you should always specify your domain as the origin
parameter value.




You can read more about it here.






share|improve this answer





















  • Adding Origin worked. For some videos, it requires Origin.I think it is required for few videos, whether its HD or not. Any idea which setting for Video upload asks for it?
    – andyPaul
    Nov 22 at 23:23










  • What setting are you looking for while uploading the video?
    – PGDev
    Nov 23 at 12:16











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',
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%2f53434938%2fytplayerview-does-not-play-content-on-simulator-decoding-failed-with-error-code%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote



accepted










Try adding origin parameter to your playerVars dictionary, i.e



NSDictionary *playerVars = @{
@"controls" : @0,
@"playsinline" : @1,
@"autohide" : @1,
@"showinfo" : @0,
@"modestbranding" : @1,
@"origin":@"https://www.youtube.com"
};


From YouTube API docs,




Origin: This parameter provides an extra security measure for the IFrame API and is only supported for IFrame embeds. If you are using
the IFrame API, which means you are setting the enablejsapi parameter
value to 1, you should always specify your domain as the origin
parameter value.




You can read more about it here.






share|improve this answer





















  • Adding Origin worked. For some videos, it requires Origin.I think it is required for few videos, whether its HD or not. Any idea which setting for Video upload asks for it?
    – andyPaul
    Nov 22 at 23:23










  • What setting are you looking for while uploading the video?
    – PGDev
    Nov 23 at 12:16















up vote
0
down vote



accepted










Try adding origin parameter to your playerVars dictionary, i.e



NSDictionary *playerVars = @{
@"controls" : @0,
@"playsinline" : @1,
@"autohide" : @1,
@"showinfo" : @0,
@"modestbranding" : @1,
@"origin":@"https://www.youtube.com"
};


From YouTube API docs,




Origin: This parameter provides an extra security measure for the IFrame API and is only supported for IFrame embeds. If you are using
the IFrame API, which means you are setting the enablejsapi parameter
value to 1, you should always specify your domain as the origin
parameter value.




You can read more about it here.






share|improve this answer





















  • Adding Origin worked. For some videos, it requires Origin.I think it is required for few videos, whether its HD or not. Any idea which setting for Video upload asks for it?
    – andyPaul
    Nov 22 at 23:23










  • What setting are you looking for while uploading the video?
    – PGDev
    Nov 23 at 12:16













up vote
0
down vote



accepted







up vote
0
down vote



accepted






Try adding origin parameter to your playerVars dictionary, i.e



NSDictionary *playerVars = @{
@"controls" : @0,
@"playsinline" : @1,
@"autohide" : @1,
@"showinfo" : @0,
@"modestbranding" : @1,
@"origin":@"https://www.youtube.com"
};


From YouTube API docs,




Origin: This parameter provides an extra security measure for the IFrame API and is only supported for IFrame embeds. If you are using
the IFrame API, which means you are setting the enablejsapi parameter
value to 1, you should always specify your domain as the origin
parameter value.




You can read more about it here.






share|improve this answer












Try adding origin parameter to your playerVars dictionary, i.e



NSDictionary *playerVars = @{
@"controls" : @0,
@"playsinline" : @1,
@"autohide" : @1,
@"showinfo" : @0,
@"modestbranding" : @1,
@"origin":@"https://www.youtube.com"
};


From YouTube API docs,




Origin: This parameter provides an extra security measure for the IFrame API and is only supported for IFrame embeds. If you are using
the IFrame API, which means you are setting the enablejsapi parameter
value to 1, you should always specify your domain as the origin
parameter value.




You can read more about it here.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 22 at 17:12









PGDev

6,32721144




6,32721144












  • Adding Origin worked. For some videos, it requires Origin.I think it is required for few videos, whether its HD or not. Any idea which setting for Video upload asks for it?
    – andyPaul
    Nov 22 at 23:23










  • What setting are you looking for while uploading the video?
    – PGDev
    Nov 23 at 12:16


















  • Adding Origin worked. For some videos, it requires Origin.I think it is required for few videos, whether its HD or not. Any idea which setting for Video upload asks for it?
    – andyPaul
    Nov 22 at 23:23










  • What setting are you looking for while uploading the video?
    – PGDev
    Nov 23 at 12:16
















Adding Origin worked. For some videos, it requires Origin.I think it is required for few videos, whether its HD or not. Any idea which setting for Video upload asks for it?
– andyPaul
Nov 22 at 23:23




Adding Origin worked. For some videos, it requires Origin.I think it is required for few videos, whether its HD or not. Any idea which setting for Video upload asks for it?
– andyPaul
Nov 22 at 23:23












What setting are you looking for while uploading the video?
– PGDev
Nov 23 at 12:16




What setting are you looking for while uploading the video?
– PGDev
Nov 23 at 12:16


















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%2f53434938%2fytplayerview-does-not-play-content-on-simulator-decoding-failed-with-error-code%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

Trompette piccolo

Slow SSRS Report in dynamic grouping and multiple parameters

Simon Yates (cyclisme)