Playing video in the mirror API - google-mirror-api

I'm a little confused about playing videos in the Mirror API
Are there any restrictions for using HTML tags in "html" field?...
Alain says
Blocked HTML elements: These elements, and their contents, are removed from html payloads.
Document headers: head, title
Embeds: audio, embed, object, source, video
However looking at the documentation ...
https://developers.google.com/glass/v1/reference/timeline/insert
Accepted Media MIME types: image/* , audio/* , video/*
So ... I'm guessing that I can attach video but not embed video? Seems like a subtle distinction, so an app would have to have a main HTML card and a sub menu choice to view a video. Is this correct?

Correct. HTML video elements are stripped from inserted timeline cards, but you can attach video. Video that is attached to timeline cards is played in full screen by a native player on Glass.
If you'd like to include video with other rich content, bundling is the way to go. You can accomplish this by specifying an HTML cover card and many video cards with the same timelineItem.bundleId.

Related

Adding videos and audios in jodit and rendrering them in aframe scene using htmlembed

We are using the htmlembed library of the aframe framework to display html content (text <h_> + image ) and css styles defined by a rich text web editor (Jodit).
Now we want to put videos and audios in this html content to display them in aframe as htmlembed entity. But, the htmlembed is not able to display video type tags. Also, audio type tags are not displayed correctly.
On the other side, we can't use native entities of aframe like a-video as each entity has its own coordination system (a-video with x, y, z and htmlembed content will be positioned according to order and css properties).
Any workaround ?
PS. please add htmlembed tag to the post.

Wagtail: How to render the blocks dynamically on Admin panel?

In wagtail, I need to make a Struct/Stream Block
There is a dropdown on the top of the block(Image/Video)
If editor choose Image, VideoChooserBlock should be hidden.
And if editor choose Video, ImageChooserBlock should be hidden.
class MyBlock(StruckBlock):
category = ChoiceBlock(choices=(("image", "image"),("video", "video")))
image = ImageChooserBlock()
video = videoChooserBlock()
Here, editor should be able to choose only image or video depending on category.
Any help is appriciated.
Thanks
You may find it useful to review the code of wagtail-link-block which does something similar.
Main files to focus on:
blocks.py for displaying fields conditionally based on a ChoiceBlock
static/link_block/link_block.js and static/link_block/link_block.css to handle the DOM manipulation and styling with JavaScript and CSS
wagtail_hooks.py to insert JS and CSS

how can I test for dynamic elements on the page using protractor?

I am setting up protractor tests for my angularJs 1.14 app.
We have a video player that displays subtitles. Each subtitle is in a div. When the player is playing, our code sets the class of the current subtitle to "currentSubtitle" This way, we can highlight the subtitle. In addition, we have code that causes the current subtitles's div to be scrolled to. How can I create a test that tests if the subtitle scroll is working?
I think you can do 2 things, depending on how fast the automation and the page self is.
Have you tried validating which text is visible with element(by.css('. currentSubtitle').getText(). getText() will give you the visible text, see here
Use browser.driver.executeScript('//some JS code') to determine if it scrolled, take for example this post. Then you can calculate with JS if the subtitle scroll is working
Hope it helps finding your answer

how to display the latest captured video thumbnail beside my capture button in camera app ios

I am building a camera based app. In this app I am able to display the latest captured image thumbnail beside the capture button. Now how to do the same with the video thumbnail, I mean how to display the latest captured video thumbnail beside my capture button in camera ios. Thanks in advance.
Assuming that you are enumerating the assets using an enumeration block -
For the assets that you are enumerating, check the property key ALAssetPropertyType in your enumeration block like this:
if([asset valueForProperty: ALAssetPropertyType] == ALAssetTypeVideo){
CGImageRef thumbnailVidoeImageRef = [asset thumbnail];
// Do what you want with this CGImageRef. Convert to UIImage etc.
}

Animated GIFs in Lotus Notes

I have built a HTML email newsletter containing an animated GIF Christmas Ecard which is being sent to all employees of a company who exclusively use Lotus Notes.
The problem I'm having is that they are receiving the email fine, but the GIF isn't animating.
Any idea if there's a way to get this working?
You could ensure that the first frame of the gif looks nice so that the animation is an 'added benefit' rather than a requirement.
That they had one come through last year seems amazing to me. But if that is actually the truth it might have had something to do with the file size being too large. You should try to keep them under 40kb
Click Create in the toolbar above the email message. Click on the Picture option and then choose GIF from the pull-down menu. Go to the folder location of the animated GIF that you want to embed in the email. Click and highlight the file. Click the Import button to add the animated GIF.

Resources