Javascript functions

Seek help running and customizing Nuevoplayer Please do not post bug reports, or feature requests here.

Javascript functions

Postby videndel » Tue May 11, 2010 1:58 pm

I was wandering if there's some javascript function for the player to make some stuff like: change the video, run a different playlist, play a different item on the playlist, etc.

I know jwplayer can do that kind of stuff and I've been using it but non of them works for nuevo player like play_item() and load_file()

Can you tell me if there is any of this for nuevo player?

Here is an example of the page using nuevo player as a playlist
http://www.videndel.dk/video_playlist.p ... st&pid=158

Thanks in advance
videndel
 
Posts: 4
Joined: Tue May 11, 2010 12:34 pm

Re: Javascript functions

Postby nuevolab » Wed May 12, 2010 10:31 am

Do not compare players.
Each player works in different way, has different flashvars, names, etc.

I already described one mthod how you can change player's container:
playlist-p163.html#p163

Also with latest build 3.20 of Nuevoplayer current jvascript call for new video is simple if you get player's container id.

So link can be
Code: Select all
<a href="javascript:loadVideo('full video URL here')">Video title</a>

And javascript function then:

Code: Select all
function loadVideo(url) {
  var player = document.getElementById('nuevoplayer');
  player.loadFile({file:url});
  player.sendEvent('play');
}


You can skip 'player.sendEvent('play'); if player is in autostart mode.
You must be sure of your player "id". Usually I set it to "nuevoplayer" in file "view_video_nuevoplayer.tpl"

It's easy to find that you can send many different player's events using javascript.
In example above you can see how to send "play" event
Other events can be:

- player.sendEvent('pause');
- player.sendEvent('stop');
- player.sendEvent('voulume',value); - value from 0-100
- player.sendEvent('scrub',value); - change position (value in seconds)
- player.sendEvent('fullscreen'); - set to fullscreen.
- player.sendEvent('playitem',value); this will play video from playlist file, where value is number of video item in playlist.

Best all of it works with latest build.
Also youtube streaming (jumping to position) was improoved in latest build.
And small modification to rtmp streaming set (for fms servers)

I set most of javascript calls similar to jwplayer, just to make it easier for webmasters.

D.
nuevolab
Site Admin
 
Posts: 29
Joined: Sun Sep 06, 2009 2:32 am


Return to Troubleshooting & 'How Do I' Questions

Who is online

Users browsing this forum: No registered users and 0 guests

cron