add avi to play to profiles

pull/702/head
Luke Pulverenti 11 years ago
parent 2c7aaa5293
commit 3de715ab88

@ -8,9 +8,11 @@ namespace MediaBrowser.Dlna
{ {
public IEnumerable<DlnaProfile> GetProfiles() public IEnumerable<DlnaProfile> GetProfiles()
{ {
var profile0 = new DlnaProfile var list = new List<DlnaProfile>();
list.Add(new DlnaProfile
{ {
Name = "Samsung TV (B Series) [Profile]", Name = "Samsung TV (B Series)",
ClientType = "DLNA", ClientType = "DLNA",
FriendlyName = "^TV$", FriendlyName = "^TV$",
ModelNumber = @"1\.0", ModelNumber = @"1\.0",
@ -32,13 +34,19 @@ namespace MediaBrowser.Dlna
Containers = new[]{"mkv"}, Containers = new[]{"mkv"},
MimeType = "x-mkv", MimeType = "x-mkv",
Type = DlnaProfileType.Video Type = DlnaProfileType.Video
},
new DirectPlayProfile
{
Containers = new[]{"avi"},
MimeType = "x-msvideo",
Type = DlnaProfileType.Video
} }
} }
}; });
var profile1 = new DlnaProfile list.Add(new DlnaProfile
{ {
Name = "Samsung TV (E/F-series) [Profile]", Name = "Samsung TV (E/F-series)",
ClientType = "DLNA", ClientType = "DLNA",
FriendlyName = @"(^\[TV\][A-Z]{2}\d{2}(E|F)[A-Z]?\d{3,4}.*)|^\[TV\] Samsung", FriendlyName = @"(^\[TV\][A-Z]{2}\d{2}(E|F)[A-Z]?\d{3,4}.*)|^\[TV\] Samsung",
ModelNumber = @"(1\.0)|(AllShare1\.0)", ModelNumber = @"(1\.0)|(AllShare1\.0)",
@ -59,13 +67,19 @@ namespace MediaBrowser.Dlna
Containers = new[]{"mkv"}, Containers = new[]{"mkv"},
MimeType = "x-mkv", MimeType = "x-mkv",
Type = DlnaProfileType.Video Type = DlnaProfileType.Video
},
new DirectPlayProfile
{
Containers = new[]{"avi"},
MimeType = "x-msvideo",
Type = DlnaProfileType.Video
} }
} }
}; });
var profile2 = new DlnaProfile list.Add(new DlnaProfile
{ {
Name = "Samsung TV (C/D-series) [Profile]", Name = "Samsung TV (C/D-series)",
ClientType = "DLNA", ClientType = "DLNA",
FriendlyName = @"(^TV-\d{2}C\d{3}.*)|(^\[TV\][A-Z]{2}\d{2}(D)[A-Z]?\d{3,4}.*)|^\[TV\] Samsung", FriendlyName = @"(^TV-\d{2}C\d{3}.*)|(^\[TV\][A-Z]{2}\d{2}(D)[A-Z]?\d{3,4}.*)|^\[TV\] Samsung",
ModelNumber = @"(1\.0)|(AllShare1\.0)", ModelNumber = @"(1\.0)|(AllShare1\.0)",
@ -85,13 +99,19 @@ namespace MediaBrowser.Dlna
Containers = new[]{"mkv"}, Containers = new[]{"mkv"},
MimeType = "x-mkv", MimeType = "x-mkv",
Type = DlnaProfileType.Video Type = DlnaProfileType.Video
},
new DirectPlayProfile
{
Containers = new[]{"avi"},
MimeType = "x-msvideo",
Type = DlnaProfileType.Video
} }
} }
}; });
var profile3 = new DlnaProfile list.Add(new DlnaProfile
{ {
Name = "Xbox 360 [Profile]", Name = "Xbox 360",
ClientType = "DLNA", ClientType = "DLNA",
ModelName = "Xbox 360", ModelName = "Xbox 360",
TranscodingProfiles = new[] TranscodingProfiles = new[]
@ -106,12 +126,22 @@ namespace MediaBrowser.Dlna
Container = "ts", Container = "ts",
Type = DlnaProfileType.Video Type = DlnaProfileType.Video
} }
},
DirectPlayProfiles = new[]
{
new DirectPlayProfile
{
Containers = new[]{"avi"},
MimeType = "x-msvideo",
Type = DlnaProfileType.Video
}
} }
}; });
var profile4 = new DlnaProfile list.Add(new DlnaProfile
{ {
Name = "Xbox One [Profile]", Name = "Xbox One",
ModelName = "Xbox One", ModelName = "Xbox One",
ClientType = "DLNA", ClientType = "DLNA",
FriendlyName = "Xbox-SystemOS", FriendlyName = "Xbox-SystemOS",
@ -127,18 +157,55 @@ namespace MediaBrowser.Dlna
Container = "ts", Container = "ts",
Type = DlnaProfileType.Video Type = DlnaProfileType.Video
} }
},
DirectPlayProfiles = new[]
{
new DirectPlayProfile
{
Containers = new[]{"avi"},
MimeType = "x-msvideo",
Type = DlnaProfileType.Video
}
} }
}; });
var profile5 = GetDefaultProfile(); list.Add(new DlnaProfile
profile5.Name = "Sony Bravia TV (2012)"; {
profile5.ClientType = "TV"; //Linksys DMA2100us does not need any transcoding of the formats we support statically
profile5.FriendlyName = @"BRAVIA KDL-\d{2}[A-Z]X\d5(\d|G).*"; Name = "Sony Bravia TV (2012)",
ClientType = "DLNA",
FriendlyName = @"BRAVIA KDL-\d{2}[A-Z]X\d5(\d|G).*",
TranscodingProfiles = new[]
{
new TranscodingProfile
{
Container = "mp3",
Type = DlnaProfileType.Audio
},
new TranscodingProfile
{
Container = "ts",
Type = DlnaProfileType.Video
}
},
DirectPlayProfiles = new[]
{
new DirectPlayProfile
{
Containers = new[]{"avi"},
Type = DlnaProfileType.Video,
MimeType = "avi"
}
}
});
//WDTV does not need any transcoding of the formats we support statically //WDTV does not need any transcoding of the formats we support statically
var profile6 = new DlnaProfile list.Add(new DlnaProfile
{ {
Name = "WDTV Live [Profile]", Name = "WDTV Live",
ClientType = "DLNA", ClientType = "DLNA",
ModelName = "WD TV HD Live", ModelName = "WD TV HD Live",
@ -156,27 +223,32 @@ namespace MediaBrowser.Dlna
Type = DlnaProfileType.Video Type = DlnaProfileType.Video
} }
} }
}; });
var profile7 = new DlnaProfile list.Add(new DlnaProfile
{ {
//Linksys DMA2100us does not need any transcoding of the formats we support statically //Linksys DMA2100us does not need any transcoding of the formats we support statically
Name = "Linksys DMA2100 [Profile]", Name = "Linksys DMA2100",
ClientType = "DLNA", ClientType = "DLNA",
ModelName = "DMA2100us" ModelName = "DMA2100us",
};
return new[] DirectPlayProfiles = new[]
{ {
profile0, new DirectPlayProfile
profile1, {
profile2, Containers = new[]{"mp3", "flac", "m4a", "wma"},
profile3, Type = DlnaProfileType.Audio
profile4, },
profile5,
profile6, new DirectPlayProfile
profile7 {
}; Containers = new[]{"avi", "mp4", "mkv", "ts"},
Type = DlnaProfileType.Video
}
}
});
return list;
} }
public DlnaProfile GetDefaultProfile() public DlnaProfile GetDefaultProfile()

@ -77,8 +77,6 @@ namespace MediaBrowser.Dlna.PlayTo
private static bool IsSupported(DirectPlayProfile profile, string path) private static bool IsSupported(DirectPlayProfile profile, string path)
{ {
// TODO: Support codec list as additional restriction
var mediaContainer = Path.GetExtension(path).TrimStart('.'); var mediaContainer = Path.GetExtension(path).TrimStart('.');
if (!profile.Containers.Any(i => string.Equals(i.TrimStart('.'), mediaContainer, StringComparison.OrdinalIgnoreCase))) if (!profile.Containers.Any(i => string.Equals(i.TrimStart('.'), mediaContainer, StringComparison.OrdinalIgnoreCase)))
@ -88,6 +86,8 @@ namespace MediaBrowser.Dlna.PlayTo
// Placeholder for future conditions // Placeholder for future conditions
// TODO: Support codec list as additional restriction
return true; return true;
} }

Loading…
Cancel
Save