Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Disabling control bar


I'm trying to disable the control bar completely. The only thing I want is the player with the Play icon in the middle. I dont want any kind of other control at the bottom.

I understand very little about flash but thought this would be easy to do... well I can't figure it out. Any help?

15 Community Answers

JW Player

User  
0 rated :

You can do it quite easily without messing with Flash.

See the supported flashvars here: *http://code.longtailvideo.com/trac/wiki/FlashVars*

controlbar=none

JW Player

User  
0 rated :

Thanks alot! Got it to work! I knew it had to be simple!

JW Player

User  
0 rated :

How can I disable controls on the fly. F.e. I want to play first item with controls disabled and the second item with controls enabled. How can I do it without recreating the player?

JW Player

User  
0 rated :

@Yelena,

For the first track, use:bc.. <creator>commercial</creator>

JW Player

User  
0 rated :

I faced the next trouble: I used old version of jw flv player and it doesn't work with property <creator>commercial</creator> or <author>commercial</author>. I forgot to say that I load files in runtime with javascript. So, I do this:

addItem(playerId, {file: flvFile, image: image, author: 'commercial', 0);

it doesn't work - file loading and playing but controls enabled.

I installed last version of media player. And do this:

var player = getPlayer(playerId);
player.sendEvent("LOAD", {file: flvFile, author: 'commercial'});
player.sendEvent("PLAY","true");

it works. BUT doesn't work this:

var player = getPlayer(playerId);
var obj1 = {file: flvFile1, author: 'commercial'};
var obj2 = {file: flvFile2};
var lst = new Array(obj1, obj2);
player.sendEvent("LOAD", lst);
player.sendEvent("PLAY","true");

Console says me that player.sendEvent("LOAD", lst); is not a function.

Am I doing smth wrong?

JW Player

User  
0 rated :

The method that you are using to load an array doesn't work.

Here is a method that does work:

1) You must always load a minimum of *file* and *type* for each track,

2) the item to be loaded must be a JavaScript object, not an array,

3) you can use *concat* to concatenate two or more objects.

Sample code:bc.. <scripttype="text/javascript">
varplayer=null;
var newPlaylist = null;

functionplayerReady(obj)
{
player=document.getElementsByName(obj.id)[0];
setTimeout("makePlaylist()",100);
};

functionmakePlaylist()
{
var obj1 = {file:flvFile1, type:'video', author: 'commercial'};
varobj2 ={file:flvFile2,type:'video'};
var obj3 = {file:flvFile3, type:'video'};
varnewPlaylist=obj1.concat(obj2, obj3);
setTimeout("player.sendEvent('LOAD',newPlaylist)", 0);
setTimeout("player.sendEvent('PLAY', 'true'), 100);
};
</script>


*newPlaylist* must be declared global for it to work in the setTimeout() method.

It's been noted that you must wrap sendEvent in a setTimeout() method for it to work.

Also, in an XSPF playlist, the correct element to use is <creator>commercial</creator> not author.

_Disclaimer: I haven't tested this EXACT code, but it should work. If it doesn't, you can come back here, smack me in the head (figuratively speaking...), and I'll help you fix it.]_

JW Player

User  
0 rated :

Hi! )) *smacking you in the head*

It's me again. Your code works, except

bc.. var newPlaylist = obj1.concat(obj2, obj3);


We can't concat objects, only arrays. But I found that works

bc.. newPlaylist = {obj1:obj1,obj2:obj2};


(strange solution but capable)

But I stumble at another problem: I need to play videos exactly one by one, first is first and second is second. But when I refresh the page sometimes second video plays earlier that first one. How can I resolve this?

And any more: after upgrading to media player from flv player API function getUpdate() doesn't work any more. But I need to track start and end playing events. How can I do it now?

May be I didn't notice new manual with new API? I found just this one:
http://code.longtailvideo.com/trac/wiki/FlashAPI


Thanks a lot for attention!!!

JW Player

User  
0 rated :

Found ModelListener for play events to track start and end events.
But question with video order remains.

JW Player

User  
0 rated :

Ouch!

I've haven't had any problem concatenating objects:bc.. functionaddPlaylist(newItem)
{
newItem.duration='';
newItem.type='sound';
varoldList=player.getPlaylist();
varnewList=oldList.concat(newItem);
player.sendEvent("LOAD",newList);
};


where *newItem* is an object:bc.. addPlaylist({link:'http://www.google.com/', file: 'song2.mp3', title:'Song 2', image:'image02.jpg', author:'Author 2', description:'The Second Song'});


The video order for the v4.x player is set by the flashvar *shuffle* which should be *_false_* by default. Try setting it explicitly.

For examples of the v4.x API, look through recent posts in the *Javascript interaction* forum.

JW Player

User  
0 rated :

Hi!

shuffle = false works only in v3 player.

Well, I have the next thing:
player v3 (example http://www.expert.ru/scripts/294884/415009/v3.phtml):

works:
1. loading videos in runtime
2. links from display
3. straight videos order

need:
1. disabled controlls on first video (none of author or category or album etc. commercial doesn't work http://code.longtailvideo.com/trac/wiki/Playlists3)
2. link from display pause the video first. Is it possible to relocate immediatelly?


player v4 (example http://www.expert.ru/scripts/294884/415009/v4.phtml):

works:
1. loading videos in runtime
2. 'commercial' property to disable controls

need:
1. working link from display (not from button on control bar), not to pause video on first click
2. straight videos order


I don't care what version of player I'll use, I need just work it right.

Thank you for your patience and help!

JW Player

User  
0 rated :

@Yalena,

I would go with the v4.x player. Be sure that you get the very latest v4.0.46 from: *http://www.jeroenwijering.com/embed.player.swf* or from the Subversion repository at: *http://code.longtailvideo.com/trac/*

bc.. <scripttype="text/javascript">
/*<![CDATA[*/
functioncreatePlayer(playerId)
{
//varso=newSWFObject('/js/jw_flv_player/flvplayer.swf',playerId,'425','240','9.0.124');
varso=newSWFObject('/js/mediaplayer/player.swf',playerId,'425','240','9.0.124');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addVariable('controlbar','over');
so.addVariable('repeat','true');
so.addVariable('autostart','false');
so.addVariable('shuffle','false');
so.addVariable{'file','dummy.flv');
so.addVariable('title','');
so.addVariable('image','');
so.addVariable('link','');
so.addVariable('displayclick','link');
so.addVariable('linktarget','_blank');
so.write('video');
}

varadFoxXmlPath='http://ads.adfox.ru/getCode?p1=kut&p2=bgx';

varexpertVideo='/video/411987_kudrin.flv';

/*]]>*/
</script>




*Notes:*

1)Thev4playerdoesn'tuse*enablejsorjavascriptid*.

2)Thev4playerdoesn'tuse*displayheight*.
Theequivalenttogetthecontrolbaroverthedisplayareaiscontrolbar=over.

3)*repeat=list*isnotsupported;only_true/false_.

4)IfyouaregoingtousetheJavaScriptAPI,youmustspecifyaminimumversion
oftheFlashPlayerofatleastv8,_MUCH_betterwouldbev9and
sincemanyearlyversionofv9werebuggy,v9,0,124,0wouldbebest.

5)The*height&width*flashvarsarenotneededwiththev4.xplayer.

6)Youmustspecifya*file*,adummyisOKifyouaregoingtoloadafilelater.

7)The*id*flashvarisnotsupportedbythev4.xplayer.

8)The"color"flashvarsarenotsupportedbythev4.xplayer.

9)Thecorrectflashvarforalinkis*link*_NOT_info.

10)*displayclick=link*hasreplacedlinkfromdisplay.

11)The*callback*flashvarisnotsupportedbythev4.xplayer.

JW Player

User  
0 rated :

Hi..

It seems to work but again not exactly what I need.
I need to play first video with displayclick=link and the second video with displayclick=play. I couldn't find how to make it work right, so I have to reload player. Everything is good except playlist doesn't refreshes. I say exactly in the script to change object in the playlist. Or reload playlist. But it still playing the first video ((

http://www.expert.ru/scripts/294884/415009/v4.phtml

Or may be I can change to displayclick=play on the fly?

JW Player

User  
0 rated :

@Yalena,

Generally, to change a flashvar, you have to re-instantiate the player.

The exceptions are the flashvars relating to a file (url, author, title, link, etc.) that can be changed by loading a new file.

Now... if you want to make a real mess of things :)set displayclick=link, then in the info element of the second track, put some javascript that starts the player. This will effectively make the displayclick=play for the second track.

JW Player

User  
0 rated :

@kLink
Hi,

I have an issue while implementing playlist, I dont want first video to show specific controls like slider, navigation etc. and want second to show the controls, pls let me know how can this be done and I am using jw player version 5. I tried <creator>commercial</creator> in xml but its not working.

Thanks,
Sagar

Ethan Feldman

JW Player Support Agent  
0 rated :

@sagar, you need to use Adtonomy Video to do this with V5 – http://www.longtailvideo.com/addons/plugins/80/Adtonomy-Video-Ads-(Run-Your-Own-Ads)

This question has received the maximum number of answers.