Microsoft Bot Framework:task module - microsoft-graph-api

I am sending adaptive cards to teams and wanted to open a iframe on clicking a button in card using task module.Using hero cards iframe can be opened but when using adaptive cards iframe is not opened.
On getting task invoke I am sending
{
task: {
type: 'continue',
value: {
title: 'Iframe',
height: 400,
width: 500,
url,
fallbackUrl: url
}
}
};
the above object as response
I am using Action.Submit for adaptive cards

Related

YouTube iframe api won't play from click handler on iOS

I am using the Youtube iframe api to show a custom thumbnail and play button over an embedded video. It is working everywhere (including android) except for iOS, where I get "If playback doesn't begin shortly, try restarting your device" behind the thumbnail. If I hide the thumbnail, I can play the video using Youtube's play button (before using my controls) and the html5 play button (after using my controls)
I am aware of the restriction on autoplaying videos, but this should get around that because it is triggered by a click handler, and works on android which has the same restriction
function loadVideo(videoID, title, description, thumbUrl, waitPlay) {
var playBtn = jQuery(".playerThumb");
jQuery(".playerTitle").text(title);
jQuery(".playerDesc").text(description);
jQuery(".playerEmbed").replaceWith("<div id='video' class='playerEmbed'></div>");
playBtn.css("background-image", "url(" + thumbUrl + ")").show().off('click').removeClass("ready");
jQuery("html, body").animate({ scrollTop: 0 }, 400, "swing", function(){});
ytPlayer = new YT.Player('video', {
videoId: videoID,
playerVars: {
rel: 0,
showinfo: 0,
autoplay: (waitPlay === true ? 0 : 1)
},
events: {
'onReady': onReady,
'onError': function(e){console.error(e);},
'onStateChange': function(e){if (e.data == YT.PlayerState.PLAYING) jQuery(".playerThumb").fadeOut();}
}
});
function onReady(e) {
playBtn.click(function() {ytPlayer.playVideo();}).addClass("ready");
if (waitPlay !== true) {
if (ytPlayer.getPlayerState() == YT.PlayerState.PLAYING) {
playBtn.hide();
}
}
}
}
How can I get this to work on iOS? Is my only option to just use the default play button for iOS?
Had the same issue and found the solution.
It turns out that on iOS you can't overlay the youtube video with any div, the user needs to click directly on the youtube iframe for the video to start.

JW Player not showing flash mode and also showing no player controls on an Asp.Net MVC view

I am using jwPlayer 6.8 on a View in my Asp.Net MVC application.
I am using following javascript code for streaming a video on player:
var el = document.getElementById("player");
var player = jwplayer(el).setup({
file: "W-UNIT1",
streamer: "rtmp://my-server/live",
type: "rtmp",
width: 383,
height: 300,
controls: true,
primary: "flash",
modes: [
{ type: "flash", src: '/jwPlayer68/jwplayer.flash.swf' },
{ type: "html5" }
],
events: {
onReady: function () {
player.play();
}
}
});
The player plays video fine but if I right click on player surface it shows me regular window's context menu but not flash menu like Settings, Global Settings etc.
Also no controls appear on player like mute, play/pause etc.
Current version I am using is version 6.8. My browser is Firefox version 27.0.1
What am I missing?
you are using Jwplayer 6.8, then try using below setup instead of your.
jwplayer("myElement").setup({
playlist: [{
image: "/assets/myVideo.jpg",
sources: [{
file: "rtmp://example.com/application/mp4:myVideo.mp4"
},{
file: "/assets/myVideo.mp4"
}]
}],
height: 360,
primary: "flash",
width: 640
});
I think your setup is following old jwplayer parameters.
Jwplayer have guide for this here
Using RTMP streaming
RTMP single stream
Helpful Stackoverflow questions :
how-do-i-play-rtmp-streams-with-jw-player
streaming-with-cloudfront-to-jwplayer
using-dynamic-smil-file-with-jw-player
It seems like I have once again found answer to my own raised question.
Issue is neither related to rtmp streaming nor is specific to any specific version of JW Player. In fact it occurs not only on newer versions plus older versions.
It was occurring because of some custom css of mine, applied onto the JW Player HTML div container. For some reason I was overriding its CSS in my Asp.Net View and it was causing this issue.
My example code:
HTML:
<body>
<script src="http://jwpsrv.com/library/bfifOqXfEeOr_yIACi0I_Q.js"></script>
<div id="player"></div>
</body>
Javascript:
$(function() {
var el = document.getElementById("player");
var player = jwplayer(el).setup({
file: "http://techslides.com/demos/sample-videos/small.mp4",
width: 383,
height: 300,
controls: true,
events: {
onReady: function () {
player.play();
}
}
});
});
CSS:
div[id^=player_]
{
/* Comment this css for correct working of jwplayer */
min-width:383px !important;
min-height:300px !important;
}
Here is the jsFiddle for this:
http://jsfiddle.net/QCyzh/2/

disable showing thumbnails at the end of video in iframe apii

I use youtube iframe api for embedding some videos. I observe that at the end of the video, api displays some thumbnails/videos (as recommendations) for next watch.
How can I disable that? I want it to be blank or can I customize? I do something like this:
function onYouTubeIframeAPIReady() {
player = new YT.Player('player1', {
height: YTPlayerHeight,
width: YTPlayerWidth,
playerVars: { 'autoplay': 1, 'showinfo' : 0, controls: 0 },
videoId: firstVideoId,
events: {
'onReady': onReady,
'onStateChange': onPlayerStateChange
}
});
}
Pleas help
Setting rel: 0 as one of the playerVars will disable the end screen. All of the supported parameters are listed in the documentation.
Just setting parameter - related: false

some questions on youtube IFrame API

With IFrame API, whether a video is played with html5 container or flash container depends on a lot of factors. I'm wondering: is it possible to set some parameter or call a function to force the player to be flash(or html5)?
besides, rel=0 seems not work in Iframe API, when I set it to 0, the related videos are still shown, is there something wrong with my code? thanks!
player = new YT.Player('player', {
height: '300', //720
width: '400', //1280
videoId: 'S2Rgr6yuuXQ',
playerVars: { 'rel': 0 }, // or rel: 0, rel: '0', all don't work
events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange,
'onError': onErrorDetected,
'onPlaybackQualityChange': onQualityChange
}
});
I think that the iframe option does not include a parameter to select html5 or flash option , because the iframe API uses the best option automatically.
you can try to specify to use HTML5 if available:
Force HTML5 youtube video
YouTube video in HTML5
and you can use the SWFObject option to use only the flash player in the client (if the client supports flash ..)
Using playerVars: { html5: 1 } loads an iframe with a html5=1 attribute in the src, similar to Force HTML5 youtube video.
Replace
playerVars: { 'rel': 0 }
with
playerVars: { 'rel': '0' }

Remove YouTube related videos in this script

I have seen this script to auto-mute video's from youtube embedded on a site:
How do I automatically play a Youtube video (IFrame API) muted?
The code is available on fiddle:
http://jsfiddle.net/9RjzU/3/
However I would like to know what to add to this code to prevent related videos appearing?
Thanks
Azzam
In your situation, all that is needed is to add 'rel': 0 to the PlayerVars parameters, like so:
function onYouTubePlayerAPIReady() {
player = new YT.Player('player', {
playerVars: {
'autoplay': 1,
'controls': 1,
'autohide': 1,
'wmode': 'opaque',
'rel': 0
},
videoId: 'JW5meKfy3fY',
events: { 'onReady': onPlayerReady }
});
}
You might also be interested in the full list of parameters available for the YouTube iframe API, found here: https://developers.google.com/youtube/player_parameters#Parameters

Resources