'; // Alternate content $return[] = $element['#value']; // Close the video tag $return[] = ''; // Format the result nicely $return = embed_format_output($return); // Return the result return $return; } /** * Clear object attributes that aren't valid on the video tag. * * @param $element * The element to be modified. * @return * Nothing - the element is modified directly by reference. */ function embed_video_unset_object_attributes(&$element) { // Unset object attributes that are not valid for video tag $attributes = array( 'data', 'type', 'name', 'usemap', 'form', ); foreach ($attributes as $attribute) { unset($element['#attributes'][$attribute]); } return; } /** * Set additional attributes on the video object. * * @param $element * The element to be modified. * @return * Nothing - the element is modified directly by reference. */ function embed_video_set_video_attributes(&$element) { // There may be other valid attributes to be moved from #object_data to #attributes $attributes = array( 'poster', 'autobuffer', 'autoplay', 'loop', 'controls', ); foreach ($attributes as $attribute) { if (isset($element['#object_data'][$attribute])) { $element['#attributes'][$attribute] = $attribute; } } return; }