I suggest to use Silverlight Media Framework, it really simplifies development of video applications. You can download its source code here: http://smf.codeplex.com/downloads/get/386528.
However, you can do some things without framework
- How I can detect the currently playing language in video
Here is the code:
var currentSegment = mediaElement.ManifestInfo.Segments[mediaElement.CurrentSegmentIndex.Value];
var currentAudioStream = currentSegment.SelectedStreams.Where(i => i.Type == MediaStreamType.Audio).FirstOrDefault()
- I want to change the currently playing audio track to the selected one
Something like this:
foreach (var segment in mediaElement.ManifestInfo.Segments)
{
var newStreams = new List<StreamInfo>();
// use current video streams
var selectedVideoStreams = segment.SelectedStreams.Where(i => i.Type != MediaStreamType.Audio).ToList();
newStreams.AddRange(selectedVideoStreams);
// add a new audio stream
newStreams.Add(newAudioStream);
// replace old streams by new ones
segment.SelectStreamsAsync(newStreams);
}