AEM6.5 cannot user path for selecting video in video component - aem

We would like the editors to be able to use the path selector as well as drag and drop when they select an MP4 file for the video component. At the moment only the drag and drop for video file works. That means, only when you drag and drop an MP4 file from Assets will this be taken into account for the video component. For the image component one can drag an drop an image from Assets or select it using the path.
I am attaching the video component _cq_diaglog/.content.xml
<file jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog/fileupload"
name="./videoFile"
fieldLabel="Video"
fileNameParameter="./videoFileName"
fileReferenceParameter="./videoFileReference"
title="MP4-Video"
mimeTypes="[video/mp4]"
uploadUrl="${suffix.path}"
allowUpload="{Boolean}${not empty cqDesign.allowUpload ? cqDesign.allowUpload : false}"
autoStart="{Boolean}false"
multiple="{Boolean}false"
required="{Boolean}true"
useHTML5="{Boolean}true"
class="cq-droptarget"/>
as well as the video component _cq_editConfig.xml
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="cq:EditConfig">
<cq:dropTargets jcr:primaryType="cq:DropTargetConfig">
<video
jcr:primaryType="nt:unstructured"
accept="[video/mp4]"
groups="[media]"
propertyName="./videoFileReference"/>
</cq:dropTargets>
</jcr:root>
I am also attaching two screenhost pictures from the editor where we would like the editors to be able to select a video by browsing the path:

It turned out the Videos in DAM did not have thumbnails under Renditions. After adding thumbnail renditions for a video one can add it using the Path selector. Everything was ok with code and configuration just content was missing.

Related

how can I add subtitles using shaka-player from a .mpd file?

I'm using the shaka player with the below build.
https://ajax.googleapis.com/ajax/libs/shaka-player/3.0.8/shaka-player.compiled.js
I'm using a .mpd file and it has a subtitle file.
<AdaptationSet contentType="text" mimeType="text/vtt" lang="en" group="3" label="English">
<Label>English</Label>
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="subtitle" />
<Representation bandwidth="1732" id="7">
<BaseURL>cmaf/subtitle-en.vtt</BaseURL>
</Representation>
</AdaptationSet>
I want to display the subtitles in my video player. How can I configure the player to identify the subtitles.
with ,
player.setTextTrackVisibility(true);
We can display subtitles of one language.

Add granite:data to cq dialog textfield

I am trying to create a validation function for a textfield depending on the content of other textfield in a cq dialog in AEM 6.5.
I am trying to send within the cq:data the textfield name but I can get AEM to render these data attributes on DOM.
This is a piece of the cq dialog
<creditsTitle
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
fieldLabel="Credits Title"
name="./creditsTitle_t"/>
<creditsValue
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
fieldLabel="Credits"
validation="custo-validation"
name="./creditsValue_t">
<granite:data jcr:primaryType="nt:unstructured"
dependent-name="creditsTitle_t"/> </creditsValue>
And here is a ss of what gets rendered:
I want to be able to send to the "custo-validation" a parameter with the name of the field that it needs to check,in this case is the one above (creditsTitle_t), but it can be anywhere.
So far the only way I have found is with the granite:data but i can't get it working
Your code looks good. just make sure you're adding the granite namespace at the top of the file
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0"
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
xmlns:granite="http://www.adobe.com/jcr/granite/1.0"
sling:resourceType="cq/gui/components/authoring/dialog"
....

AEM 6.5 Pre-populate fileUpload image field in cq dialog

New to AEM, I am trying to programatically populate an fileUpload image dropzone, and silently triggered its drop event as if user had manually drop an image asset to it. Is there a way to do this?
Say I have a cq_dialog with two fileUpload image fields (set to no upload, only droppable from asset allowed), one was already populated prior, the other is empty. Upon dialog load, I want to populate the empty one with the image asset from the populated one as a default.
The snippets of the cq_dialog looks like this:
<imageontopWrap
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/container"
class="layout-showhide-targets"
showhidetargetvalue="imageontop">
<items jcr:primaryType="nt:unstructured">
<image1
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog/fileupload"
autoStart="{Boolean}false"
allowUpload="{Boolean}false"
class="cq-droptarget"
fieldLabel="Image Asset"
fileReferenceParameter="./myImageTopPath"
mimeTypes="[image]"
multiple="{Boolean}false"
name="./myImageTop"
title="Upload Image Asset"
useHTML5="{Boolean}true"/>
<altText1
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textfield"
fieldLabel="Alt Text"
name="./myImageTopAltText"/>
</items>
</imageontopWrap>
<imageonleftWrap
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/container"
class="layout-showhide-targets"
showhidetargetvalue="imageonleft">
<items jcr:primaryType="nt:unstructured">
<image2
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog/fileupload"
autoStart="{Boolean}false"
allowUpload="{Boolean}false"
class="cq-droptarget"
fieldLabel="Image Asset"
fileReferenceParameter="./myImageLeftPath"
mimeTypes="[image]"
multiple="{Boolean}false"
name="./myImageLeft"
title="Upload Image Asset"
useHTML5="{Boolean}true"/>
<altText2
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textfield"
fieldLabel="Alt Text"
name="./myImageLeftAltText"/>
</items>
</imageonleftWrap>
I had created a clientLib for this cq_dialog, just wasn't sure the js codes to copy the image reference and trigger the drop using script.
Any help is much appreciated.
Here is the mechanism through you can achive what you require I hope. I am not sure about the exact js code though for which you have to do some googling on listners.
On dialog load, store the reference of the first image drop container in a js variable.
Then find the path of the image that is being stored/authored in the first image container.
Populate the same path in the second image drop path.
As I said, above is just a mechanism to help how you can achive your requirement.

How to use cq:editConfig Property in AEM 6.0

In AEM 6.0, I am having a component and, it has a text field and one video file uploader. I want to enable the drag and drop of this video from the content finder. My normal upload using the dialog is working, but this drag and drop is not working. I searched and found out that I can do this by using cq:editConfig. Can somebidy tell me that how can I do this?
Define the cq:dropTargets, as a child of the cq:editConfig node to configure the list of drop targets that can accept a drop from an asset of the content finder.
In your case, for a video, you can refer the foundation/components/video whose edit config is shown below.
<cq:editConfig jcr:primaryType="cq:EditConfig" cq:layout="editbar">
<cq:dropTargets jcr:primaryType="nt:unstructured">
<video jcr:primaryType="cq:DropTargetConfig" propertyName="./asset">
<parameters jcr:primaryType="nt:unstructured"
sling:resourceType="foundation/components/video"/>
</video>
</cq:dropTargets>
</cq:editConfig>
Also make sure you specify the ddGroups and ddAccept properties on the html5smartfile widget used for video file upload component.
Refer Configuring the Edit Behaviour of a component to get more insights on configuring the edit config and its child nodes.
You must be careful doing this because it can have an unexpected side effect of changing your component type to the type specified in the drop target.
To avoid that happening, you can distinguish between component type and target type by using this format:
<cq:dropTargets jcr:primaryType="nt:unstructured">
<video
jcr:primaryType="cq:DropTargetConfig"
accept="[video/.*]"
propertyName="./asset">
<parameters
jcr:primaryType="nt:unstructured"
sling:resourceType="myfolder/components/videoandtext">
<video
jcr:primaryType="nt:unstructured"
sling:resourceType="foundation/components/video"
/>
</parameters>
</video>
</cq:dropTargets>
See here for more info: Drop Target Issue

Can multiple smartimage xtypes appear on one dialog tab in AEM?

The out of the box (OOTB) page properties dialog in Adobe Experience Manager (AEM) (CQ5) provides an Image tab. I would like to add a couple more images to the dialog, but I don't want to create a separate tab for each one.
For instance, is there a way to include an image on the "Advanced" tab within a dialogfielset? I tried this, but it does not seem to render properly.
One thing I am considering is to extend the slideshow xtype and each image would be a separate "slide"
Are there better approaches?
It's possible to have multiple smartimage xtypes on a tab!
Widgets API document for smartimage:
Note that the component is mainly designed for use on a separate
dialog tab. You may use the component inside a
CQ.Ext.layout.FormLayout optionally if you provide a suitable height
setting.
Here are codes for dialog:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Dialog"
height="{Long}600"
title="dialog"
xtype="dialog">
<items
jcr:primaryType="cq:Widget"
xtype="tabpanel">
<items jcr:primaryType="cq:WidgetCollection">
<panel
jcr:primaryType="cq:Panel"
title="Panel with two Images">
<items jcr:primaryType="cq:WidgetCollection">
<firstimage
jcr:primaryType="cq:Widget"
cropParameter="./firstimage/imageCrop"
ddGroups="[media]"
fieldLabel="first image field"
fileNameParameter="./firstimage/fileName"
fileReferenceParameter="./firstimage/fileReference"
height="{Long}200"
name="./firstimage/file"
rotateParameter="./firstimage/imageRotate"
title="First Image"
width="{Long}200"
xtype="html5smartimage"/>
<secondimage
jcr:primaryType="cq:Widget"
cropParameter="./secondimage/imageCrop"
ddGroups="[media]"
fieldLabel="second image field"
fileNameParameter="./secondimage/fileName"
fileReferenceParameter="./secondimage/fileReference"
height="{Long}200"
name="./secondimage/file"
rotateParameter="./secondimage/imageRotate"
title="secondimage"
width="{Long}200"
xtype="html5smartimage"/>
</items>
</panel>
</items>
</items>
</jcr:root>
And the following is the result: