Trick play of video (NETGEM STB SDK)

Posted By : Deepak Gupta | 07-Feb-2014

 

Trick play of video

 

 

Hello guys ,In this blog I tell you how to Trick play of video.In this blog I share the code for logic of trick play in netgem project .Step to Trick play of video is given below:-

In this blog I’ill tell you how to play video back and forth direction

 

var rewind=1;,fastForward=1;
MyFormWidget.prototype.onKeyPress = function onKeyPress(_key)
{
    var player = this.widgets.player;
       var res=false;
    switch (_key) {
                       
		case "KEY_PREV":
		 if(rewind<8){
		 if(fastForward==1){
		 rewind=rewind*2;
		 if(rewind<16)
		 this.widgets.player.speedSet(-rewind, true);
//set the speed according to your press button
//If you press one time prev KEY then it play video in back direction by 2 time fast
//after then pressing previous value is multiply by two

		 NGM.trace("rewind is in if ----->"+rewind);
		 }
		 else{
		 NGM.trace("rewind is in else----->"+rewind);
		 rewind=fastForward/2;
		 fastForward=rewind;
		 this.widgets.players.speedSet(rewind, true);//speed declared in the file
		    }
			}
            return true	;		
        case "KEY_NEXT":
         if(fastForward<8)	{	
		   if(rewind==1){
			fastForward=fastForward*2;	
		    if(fastForward<16)
		 this.widgets.player.speedSet(fastForward, true);

set the speed according to your press button
If you press one time prev KEY then it forward the video playing  by 2 time fast
after then pressing previous value is multiply by two
		
NGM.trace("fastForward is----->"+fastForward);
			}
			else{
			fastForward=rewind/2;
		    rewind=fastForward;
			if(fastForward==1)
			this.widgets.player.speedSet(fastForward, true);
			else
			this.widgets.player.speedSet(-fastForward, true);
			NGM.trace("fastForward is----->"+fastForward);
			}
         }
			return true;
			
						
        default:
            return this.widgets.player.keyHandler(_key);
            statusMessage.add("Wrong selection of the key...");
    }
   };

 

Thanks Deepak Gupta

About Author

Author Image
Deepak Gupta

Deepak is a bright Groovy and Grails developer

Request for Proposal

Name is required

Comment is required

Sending message..