Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request is an answer to Operation Request 246 (play audio.) It adds a new operation, "Play Media" under a new Media category.
The Play Media operation is a lot like Render Image in that it takes raw, hex, or base64 encoded data and outputs a byte array. The present function takes the byte array and produces a base64 data URI. This URI is then fed as the
src
attribute of either an<audio>
or<video>
HTML element for rendering.The type of element is determined based on the MIME type of the incoming data. It must be a valid type beginning with either 'audio' or 'video' (e.g. 'audio/x-wav' or 'video/ogg'.) The MIME type is also used to populate the
type
attribute of the media element.The ultimate result will depend on what the user's browser supports. Most common audio and video files should play in a modern browser. A fallback paragraph is rendered in case the user's browser can't support the media type.
The new operation is placed under a new category, "Multimedia". The existing Render Image operation has been moved there.