Reading audio stream information with Mozilla/ActiveX plugin

Feature requests for VLC.
Spellcoder
Blank Cone
Blank Cone
Posts: 57
Joined: 19 Apr 2006 12:21
Location: Hengelo // The Netherlands
Contact:

Reading audio stream information with Mozilla/ActiveX plugin

Postby Spellcoder » 05 Dec 2006 16:06

I'd like to have the ability get information about available audio-streams (in my case from DVD) with the browser plugin.

The DJ
Cone Master
Cone Master
Posts: 5987
Joined: 22 Nov 2003 21:52
VLC version: git
Operating System: Mac OS X
Location: Enschede, Holland
Contact:

Postby The DJ » 06 Dec 2006 03:10

This is something that will be worked on quite soon.
Don't use PMs for support questions.

Spellcoder
Blank Cone
Blank Cone
Posts: 57
Joined: 19 Apr 2006 12:21
Location: Hengelo // The Netherlands
Contact:

Postby Spellcoder » 08 Dec 2006 10:06

That's great, thank you for the answer. :D (bedankt!)

zvona
Blank Cone
Blank Cone
Posts: 11
Joined: 30 Oct 2006 10:32
Location: Helsinki

Postby zvona » 11 Dec 2006 09:25

I'll second that request for both audio- and subtitle-tracks.
Zvona

The DJ
Cone Master
Cone Master
Posts: 5987
Joined: 22 Nov 2003 21:52
VLC version: git
Operating System: Mac OS X
Location: Enschede, Holland
Contact:

Postby The DJ » 12 Dec 2006 20:22

audio track is implemented now:

http://trac.videolan.org/vlc/changeset/18383
Don't use PMs for support questions.

Spellcoder
Blank Cone
Blank Cone
Posts: 57
Joined: 19 Apr 2006 12:21
Location: Hengelo // The Netherlands
Contact:

Postby Spellcoder » 05 Jan 2007 14:01

Reading the current audio-stream ID ( = objVLC.audio.track ) and setting the audio stream (objVLC.audio.track=) works great in the 0.9.0 nightly ! (thanks!)

I have some futher requests too, because although setting audio tracks during playing was on my wishlist it doesn't give information about available audio-streams.
So I'll elaborate on what I had in mind:


Getting a list of all audio streams
Will we also get the ability to get information about the audio streams?
For example I think it would be usefull to be able to have a method that gives back an array with all streams.
Some reasons why I think it's usefull:
  • making a pulldown for selecting an audio stream
  • for when you prefer a language but if it's not available, fall back to the english audio stream
An simple example of how the array could be used would be:
(this would (if it exists) select the audio-stream in the preferred language and otherwise it will select the english audio-stream)

Code: Select all

var objVLC = document.getElementById('objVLC'); var tracklist = objVLC.audio.trackList; var prefLang = 'nl'; var prefLangAvailable = false; for(var trackID in tracklist) { if (tracklist[trackID] == prefLang) prefLangAvailable = true; } var useLang = prefLangAvailable ? prefLang : 'en'; var options = ':audio-language='+useLang; objVLC.playlist.clear(); objVLC.playlist.add(URI,null,options); objVLC.playlist.play();

Setting audio stream by language code
Also with the playlist.add options you can use :audio-language=en. It might be usefull to use these language codes too for setting an audio-stream.

Something like:
objVLC.audio.track = 'de';
or
objVLC.audio.track = objVLC.audio.getTrackIDByLanguage('de');
or
objVLC.audio.setTrackByLanguage('de');

However it won't be necessary perse anymore if the objVLC.audio.tracklist was implemented.

Spellcoder
Blank Cone
Blank Cone
Posts: 57
Joined: 19 Apr 2006 12:21
Location: Hengelo // The Netherlands
Contact:

Postby Spellcoder » 30 May 2007 15:23

I'll try to make some more arguments for getting info about audio-streams with the activeX/mozilla-plugin. Hopefully somebody is interesting in implementing it.

Getting and setting the current selected audio-stream works. However there's no way to get any information about the audio-streams. I think it's important to be able to know
  • if a audio-stream (track) exists
  • for which language an audio-stream is
As long as it's not possible with the browser plugin you get these issues, when trying to play DVD's (or multi-language videos/streams):
  • to look which streams there are you have to use try{} catch(err){} to see which streams exist
  • if you use the VLC plugin for a specific DVD you have to hardcode the the order of the audio tracks in your javascript
  • if you have a multiple DVD project you have to take into account the order of audio tracks can be different on each DVD
  • the order of audio-tracks sometimes even differ according to the start-time you use as option. (or can you change language of an audio streams per chapter?? otherwise it seems a bug to me)
  • if you're making a general DVD player you have to make the user click on audio-stream numbers, making them guess the number for their language
All of these problems could be solved if we have access to the language-info (for example the 2/3-lettercodes of the language in an audio-stream). So is anyone up for adding functionality for getting info about available streams with the browser plugin? (you'll be my hero :P)

Maybe something like:
  • streamExists = objVLC.audio.tracklist.[ streamID ]
    If it's defined that audio track exists
  • langCode = objVLC.audio.tracklist.[ streamID ].language
    This would return the two or three letter country code (as also used in the command-line option :audio-language).
my hideout: http://www.spellcoder.nl
my VLC bugreports: https://trac.videolan.org/vlc/query?rep ... spellcoder
likes coding, designing, WoW, VLC&plugin, Amiga's and Mac's & fluffy cats


Return to “VLC media player Feature Requests”

Who is online

Users browsing this forum: No registered users and 9 guests