Web Vuser Functions (WEB) > Alphabetical List of Web Vuser Functions > web_stream_set_param_int

web_stream_set_param_int

Sets the value of a stream parameter.

C Language

int web_stream_set_param_int( const char *ID, const int StateType, const int StateValue );

Example Stream Functions

Argument Description
ID The identifier passed to web_stream_open.
StateType The code for any stream parameter with an integer value, such as BANDWIDTH (11) or BUFFERING_TIMEOUT (12).
StateValue The new value for the stream parameter.

Return Values

This function returns LR_PASS (0) on success, and LR_FAIL (1) on failure.

Parameterization

Standard parameterization is not available for this function.

General Information

The web_stream_set_param_int function sets the a value of a parameter of the open stream.

This function is not recorded. You can insert it manually into your script.

Example

This is an example of a web streaming script:

Action()

{

      /**

      HTML5 Video

      /*/

      web_stream_open("ID=1", "URL=http://my_server/streaming-test/Video2/Class%20-%206.mp4","StreamBufferingTimeout=38", "Protocol=HTTP", LAST);

      web_stream_set_param_double("1",SPEED, 2.0);

      web_stream_set_param_int("1", BANDWIDTH, 2000000);

      web_stream_set_param_int("1", BUFFERING_TIMEOUT, 60);

 

      web_stream_get_state_string("1", SERVER_IP, "ServerIP");

      lr_output_message("IP:, %s",lr_eval_string("{ServerIP}"));

      lr_output_message("Movie Length : %lf",web_stream_get_param_double("1", Duration));

 

      /***

      Play a video. Seek forward,seek backward, seek from the begining, pause, and stop.

      **/

      //Play for 30 sec

 

      lr_think_time(15);

      lr_start_transaction("HTTP Stream");

 

      web_stream_play("ID=1", "PlayingDuration=30", "Speed=1.5", LAST);

      lr_vuser_status_message("Current time in movie:%lf", web_stream_get_param_double("1", CURRENT_TIME));

 

      web_stream_pause("ID=1","PausingDuration=20", LAST);

      lr_vuser_status_message("Current time in movie:%lf", web_stream_get_param_double("1", CURRENT_TIME));

 

      web_stream_play("ID=1", "PlayingDuration=10", LAST);

      lr_vuser_status_message("Current time in movie:%lf", web_stream_get_param_double("1", CURRENT_TIME));

 

      web_stream_seek("ID=1", "TimeOffset=11", LAST);

      lr_vuser_status_message("Current time in movie:%lf", web_stream_get_param_double("1", CURRENT_TIME));

 

      web_stream_play("ID=1", "PlayingDuration=10", LAST);

      lr_vuser_status_message("Current time in movie:%lf", web_stream_get_param_double("1", CURRENT_TIME));

 

      web_stream_seek("ID=1", "RelativeOffset=90", LAST);

      lr_vuser_status_message("Current time in movie:%lf", web_stream_get_param_double("1", CURRENT_TIME));

 

      web_stream_play("ID=1", "PlayingDuration=10", LAST);

      lr_vuser_status_message("Current time in movie:%lf", web_stream_get_param_double("1", CURRENT_TIME));

 

      web_stream_seek("ID=1", "RelativeOffset=-17", LAST);

      lr_vuser_status_message("Current time in movie:%lf", web_stream_get_param_double("1", CURRENT_TIME));

 

      web_stream_stop("ID=1", LAST);

 

      lr_end_transaction("HTTP Stream", LR_AUTO);

 

      web_stream_close("ID=1", LAST);

 

      return 0;

}