Ses canPlayType() Yöntemi
Örnek
Tarayıcınızın farklı ses türlerini çalabildiğini kontrol edin:
var x = document.createElement("AUDIO");
isSupp = x.canPlayType(vidType+';codecs="'+codType+'"');
Tanım ve Kullanım
canPlayType() yöntemi, tarayıcının belirtilen ses türünü oynatıp çalamayacağını kontrol eder.
canPlayType() yöntemi, aşağıdaki değerlerden birini döndürebilir:
- "muhtemelen" - tarayıcı büyük olasılıkla bu ses türünü destekliyor
- "belki" - tarayıcı bu ses türünü destekleyebilir
- "" - (boş dize) tarayıcı bu ses türünü desteklemiyor
Tarayıcı Desteği
Method | |||||
---|---|---|---|---|---|
canPlayType() | Yes | 9.0 | Yes | Yes | Yes |
Sözdizimi
audioObject.canPlayType(type)
Parametre Değerleri
Value | Description |
---|---|
type | Specifies the audio type (and optional codecs) to test support for. Common values:
Common values, including codecs:
Note: This method can only return "probably" if codecs are included. |
Teknik detaylar
Geri dönüş değeri: | Destek seviyesini temsil eden bir Dize. Olası dönüş değerleri:
|
---|
❮ Ses Nesnesi