I want to make a script that plays all videos of YouTube channel and perform player settings and return status.
Execution of the following command does not create any error on java stacktrace but, neither has effect on YouTube player.
player.nextVideo()
(command does not move to next video),player.previousVideo()
(command does not move to previous video), andplayer.setShuffle(true)
.
Here is a complete script. My code use FlexWebDriver class, described for instance here.
import org.openqa.selenium.firefox.FirefoxDriver;
public class Youtube {
public static void main(String[] args) throws InterruptedException {
FirefoxDriver driver = new FirefoxDriver();
FlexWebDriver flashApp = new FlexWebDriver(driver, "movie_player");
driver.get("http://www.youtube.com/watch?v=fZUTMprV9dI&list=UUQc_OGfP0IsgOWT0vosmQjg&feature=plpp_play_all");
Thread.sleep(5000L);
flashApp.call("nextVideo");
flashApp.call("previousVideo");
flashApp.call("setShuffle","true");
}
}