Easy A
Would you like to react to this message? Create an account in a few clicks or log in to continue.


 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

Share
 

 What happens when ajax call is invoked?

View previous topic View next topic Go down 
AuthorMessage
Carabella
Member
Member
Carabella

Posts : 3
Join date : 2011-05-08

What happens when ajax call is invoked? Empty
PostSubject: What happens when ajax call is invoked?   What happens when ajax call is invoked? EmptyFri Jun 17, 2011 9:01 am

What happens when we create setTimeout or Ajax call?

I have a problem with invoking autoplay in HTML5 player on iPad.

If I call thing like that:

[CODE]
function playItem()
{
var playerArea = $('#playerArea');
var flowplayerAjdi = getFlowplayerId();
playerArea.empty();
playerArea.append(createQualityChooserHTML()+'<div><a id="'+flowplayerAjdi+'" class="'+flowplayerAjdi+'"></a></div><div id="hulu" class="hulu"></div>');
clipProperties.url = 'http://192.168.100.107:1935/ia/live/playlist.m3u8';
playLiveFlowplayer(flowplayerAjdi, getWowzaUrl('ia'), '', '', true, true);
}[CODE]

everything works fine. But you can see that url is hardcoded - it has to be assigned by ajax call. So here is what I did:

[CODE] function playItem()
{
$.ajax({
url : 'playVODServlet',
type : 'GET',
data : JSON.stringify(playItemParams),
timeout : 5000,
dataType : "json",
error : function(xhr, ajaxOptions, thrownError)
{
console.error("Error");
},
success : function(searchResult)
{
var playerArea = $('#playerArea');
var flowplayerAjdi = getFlowplayerId();
playerArea.empty();
playerArea.append(createQualityChooserHTML()+'<div><a id="'+flowplayerAjdi+'" class="'+flowplayerAjdi+'"></a></div><div id="hulu" class="hulu"></div>');
clipProperties.url = searchResult.assetId;
playLiveFlowplayer(flowplayerAjdi, getWowzaUrl('ia'), '', '', true, true);
}
});

}[CODE]

An now autostart doesn't work.

So my question is: what could be the problem? It looks it is related with ajax call breaks normally code execution and creates error and success function. Same thing happens if I put player constructor to setTimeout.

best
Back to top Go down
 

What happens when ajax call is invoked?

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
» Ajax problem
» (AJAX => Div) don't work javascript in the div
» Facebook Login with AJAX Calls
» Ajax/jQuery Form $_POST and use PHP?
» what would you call this script?

Permissions in this forum:You cannot reply to topics in this forum
Easy A :: What happens when ajax call is invoked? Edit-trash Useless :: Trash-