@@ -29,7 +29,9 @@ var paths = {
2929 waterfall : 'waterfall.php' ,
3030 thumbnail : 'thumbnail.php' ,
3131 cancel : 'cancelTest.php' ,
32- history : 'testlog.php'
32+ history : 'testlog.php' ,
33+ videoCreation : 'video/create.php' ,
34+ videoView : 'video/view.php'
3335} ;
3436
3537var filenames = {
@@ -601,6 +603,35 @@ function listen(local, callback) {
601603 return server . listen . call ( this , local , callback ) ;
602604}
603605
606+ function getEmbedVideoPlayer ( id , options , callback ) {
607+ var params = {
608+ embed : 1 ,
609+ id : id
610+ } ;
611+
612+ options . args = options . args || {
613+ type : 'text/html' ,
614+ encoding : options . dataURI ? 'utf8' : options . encoding
615+ } ;
616+
617+ options . parser = function ( data ) {
618+ return data . toString ( ) ;
619+ } ;
620+
621+ api . call ( this , paths . videoView , callback , params , options ) ;
622+ }
623+
624+ function createVideo ( tests , options , callback ) {
625+ //prefer the json format because the xml format is buggy with wpt 2.11
626+ var params = {
627+ tests : tests ,
628+ f : 'json' ,
629+ end : options . end || 'visual'
630+ } ;
631+
632+ api . call ( this , paths . videoCreation , callback , params , options ) ;
633+ }
634+
604635// WPT constructor
605636function WebPageTest ( server , key ) {
606637 if ( ! ( this instanceof WebPageTest ) ) {
@@ -645,6 +676,8 @@ WebPageTest.prototype = {
645676 getHistory : getHistory ,
646677 getWaterfallImage : getWaterfallImage ,
647678 getScreenshotImage : getScreenshotImage ,
679+ getEmbedVideoPlayer : getEmbedVideoPlayer ,
680+ createVideo : createVideo ,
648681 scriptToString : WebPageTest . scriptToString ,
649682 listen : listen ,
650683
0 commit comments