Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Detect if html5 audio element supports volume setting #21

@Pandabehr

Description

@Pandabehr

Basically create audio tags, set volume to random number under 1 (1 is highest)
If its the volume is the same as before it doesnt support it
code gives an alert if not supported

var audio = PB.$('<audio></audio>'),
    temp = audio[0].volume;
audio[0].volume = ((temp / 5) > 0)? (temp / 5): 0.1;
if(audio[0].volume == temp) { alert('Nope'); }
audio.remove();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions