Skip to content
Pieter van Leeuwen edited this page May 8, 2015 · 1 revision
  1. The method makes video and controllers screen and checks if there's already an existing one

      `public void onNewScreen(Screen s){`
      `if(videoScreen == null){`
          `videoScreen = s;`
          `initVideoScreen();`
         `}else{`
     	    `controllerScreen = s;`
     	    `initControllerScreen();`
         `}`
     `}`
    
  2. Here we initialize the video screen and we loead the style sheet

     `private void initVideoScreen(){`
           `this.loadStyleSheet(videoScreen, "style");`
           `this.loadContent(videoScreen, "video", "video");`
      `}`
    
  3. Here we initialize the controller screen

      `private void initControllerScreen(){`
            `this.loadContent(controllerScreen, "controller", "controller");`
    

3.1 Binds a listener to the play button on the controller screen. Calls the function "playButtonClicked" in this object.

`controllerScreen.setDiv("play", "bind:click", "playButtonClicked", this);`
  1. Here we initialize the "play' and "pause" function

      `public void playButtonClicked(Screen s, String content){`
              `playing = !playing;`
              `if(playing){`
     	            `this.setContent("play", "PAUSE");`
     	            `videoScreen.putMsg("video", "", "play()");`
              `}else{`
     	            `this.setContent("play", "PLAY");`
     	            `videoScreen.putMsg("video", "", "pause()");`
              `}`
       `}`
    

Clone this wiki locally