flowplayer wowza video not playing - flowplayer

I am very new to flowplayer using wowza in order to have secure streaming. Below is the code I am using, but video not playing at all. I am pretty sure all files are loading properly without any 404 or 403 errors.
Here is the code:
<html>
<head>
<title>Wow! This is video</title>
<script src="js/flowplayer-3.1.4.min.js"></script>
</head>
<body>
<a href="videos/MyVideo.mp4"
style="display:block;width:425px;height:300px;"
id="wowza" class="player">
<!-- splash image inside the container -->
<img src="./flow_eye.jpg"
alt="Search engine friendly content" /></a>
<script language="JavaScript">
flowplayer("wowza", "swf/flowplayer-3.1.5.swf", {
log: { level: 'debug', filter: 'org.flowplayer.rtmp.,org.flowplayer.securestreaming.' },
clip: {
url: 'mp4:videos/MyVideo.mp4',
// use RTMP streaming
provider: 'rtmp',
// with a secured connection
connectionProvider: 'secure'
},
plugins: {
// set up the RTMP streaming plugin
rtmp: {
url: "swf/flowplayer.rtmp-3.2.13.swf",
// The net connection URL with HDDN looks like this
netConnectionUrl: 'rtmpte://d.securevod.flowplayervod.netdna-cdn.com:1935/securevod.flowplayervod'
},
// set up the secure streaming plugin
secure: {
url: "swf/flowplayer.securestreaming-3.2.9.swf",
// the token value (shared secret).
token: 'bky9p52t'
}
}
});
</script>
</body>
</html>
Please test it from your end and tell me what still needs to be added in above code.

Your are using wrong script.
what I see, that you are trying to make a live stream using RTMP(Real Time Messaging Protocol). and you want to play just video.
well incase of flow-player you don't need to re-invent the wheel.
just use any sample script.
Embed Videos in your Web Pages with Flowplayer

Related

Failed to syntheis speech for the Bot Framework Web Chat

I'm having a go with speech for a BOT. I have been running through the Microsoft Tutorial found here. I've taken the example Echo BOT example from there, found here, as a basis so I can use it as a basis going forward. This has been successfully deployed to my Azure environment. Also in the tutorial, you run your Bot through the Direct Line Speech Client v1, everything works as expected when doing this.
I have looked at the Bot Framework Web Chat speech notes to get the Bot working using this as my channel. Here is my code for this:
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Web Chat: Browser-supported speech</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
<style>
html, body { height: 100% }
body { margin: 0 }
#webchat {
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<div id="webchat" role="main"></div>
<script>
(async function () {
window.WebChat.renderWebChat({
directLine: createDirectLine({
secret: '<My Direct Line secret>'
}),
language: 'en-US',
webSpeechPonyfillFactory: await createCognitiveServicesSpeechServicesPonyfillFactory({
region: '<Speech cognitive service region>',
subscriptionKey: '<Speech cognitive service key>'
})
}, document.getElementById('webchat'));
document.querySelector('#webchat > *').focus();
})().catch(err => console.error(err));
</script>
</body>
</html>
I'm able to get this working and I can do speech to text and text inputs and the contents is written back, but when it tries to do text to speech back I'm getting the following errors in the browser console:
POST https://<region>.tts.speech.microsoft.com/cognitiveservices/v1 net::ERR_ABORTED 400 (Speak node can only be the root.)
webchat.js:1 Error: Failed to syntheis speech, server returned 400
at webchat.js:1
at c (webchat.js:1)
at Generator._invoke (webchat.js:1)
at Generator.e.<computed> [as next] (webchat.js:1)
at n (webchat.js:1)
at s (webchat.js:1)
I'm not quite sure if it is something in the script code or the Bot, let me know if you need any more detail. Thanks in advance!
It is weird... I hosted a echo bot on Azure and just copy and paste your html code and did some config ,I tested on edge firefox and chrome but everything works well including tts calling :
You can try it here and check the config . Hope it helps .

How do I integrate Microsoft health bot to web application

I have created few scenarios in health bot designer. I am trying to integrate with my front end. However, I don't see any complete documentation around integrate process. I have already referred https://github.com/Microsoft/HealthBot-WebChat without any luck. How do I get directline link for healthbot. I have tried with web bot and able to generate directline but not sure how to link web bot channel to health bot scenario. Any help?
You can integrate the Healthcare bot service into a web application using WebChat. First, you need to get your WebChat Secret from the Healthcare Bot Service Manager. In the pane on the left, click on the integrations blade, select secrets in the drop down options, and copy the webchat_secret.
Once you have the secret, you can request a token from DirectLine and render a WebChat component on your web app. Take a look at the example below.
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Healthcare bot</title>
<script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
<style>
html, body { height: 100% }
body { margin: 0 }
#webchat,
#webchat > * {
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<div id="webchat" role="main"></div>
<script>
(async function() {
// Note, for the simplicity of this example, we are fetching the DirectLine token here;
// however, it is recommended that you create a backend REST API to generate and manage
// your tokens.
const res = await fetch('https://directline.botframework.com/v3/directline/tokens/generate',
{
method: 'POST',
headers: {
'Authorization': `Bearer <WEBCHAT_SECRET>`,
'Content-Type': 'application/json'
},
body: {
// The user id must start with `dl` and should be unique for each user.
User: { Id: 'dl_user_id' }
}
});
const { token } = await res.json();
window.WebChat.renderWebChat({
directLine: window.WebChat.createDirectLine({ token }),
}, document.getElementById('webchat'));
})().catch(err => console.log(err));
</script>
</body>
Note, for the simplicity of this example, we are fetching the DirectLine token here; however, it is recommended that you create a backend REST API to generate and manage your tokens.
Hope this helps!
Found a way to do it. We need to add a model and enable the trigger through Health Bot Management Portal
There is a direct way to trigger a scenario from the front end. If you want to completely rely on your own responses, then you have to turn off the built-in scenarios and call a scenario name in the event post javascript code. Look at the "trigger" element below:
botConnection
.postActivity({
type: "event",
value: {
trigger: "your_scenario_name_here", args: {}
},
from: your_user_name,
name: "BeginDebugScenario"
});

Unable to use Quicksight dashboard as embeded url on S3/cloudfront whitelisted domain

I was trying to view Quicksight dashboard as embedded url from our domain which was whitelisted in AWS Quicksight account.
Our website is hosted on S3 bucket as a static website. Below sample, a javascript function is given on an AWS Blog.
Below is the sample javascript function.
function embedDashboard() {
var containerDiv = document.getElementById("dashboardContainer");
var options = {
url: "<signed URL from Step 3>",
container: containerDiv,
parameters: {
country: 'United States'
},
scrolling: "no",
height: "700px",
width: "1000px"
};
dashboard = QuickSightEmbedding.embedDashboard(options);
dashboard.on('error', onError);
dashboard.on('load', onDashboardLoad);
}
Full example is given on another link of the same blog Amazon QuickSight JavaScript SDK
Unfortunately, the sample is not working.
Below is a complete html sample page (dashboard.html), including the javascript function.
<!DOCTYPE html>
<html>
<head>
<title>My Dashboard</title>
<script type="text/javascript" src="quicksight-embedding-js-sdk.min.js"></script>
<script type="text/javascript">
function embedDashboard() {
var containerDiv = document.getElementById("dashboardContainer");
var params = {
url: "<signed URL>",
container: containerDiv,
parameters: {
},
height: "700px",
width: "1000px"
};
var dashboard = QuickSightEmbedding.embedDashboard(params);
dashboard.on('error', function(err) {console.log('dashboard error:', err)});
dashboard.on('load', function() {});
}
</script>
</head>
<body onload="embedDashboard()">
<div id="dashboardContainer"></div>
</body>
</html>
Sample is taken from same AWS blog and made some changes.
Overall steps are summarized below.
Below line was changed.
Above line was changed with below line.
Downloaded .js and lib files
Some .js and lib files were also downloaded from below address and uploaded on the website with the dashboard.html page.
https://unpkg.com/amazon-quicksight-embedding-sdk#1.0.2/dist/
S3/Cloudfront configuration
Since whitelisted domain on quicksight setting is an https url, so had to configure s3 static website with Cloudfront.
--created s3 bucket with dashboard.mydomain.com.au
--created Cloudfront web distribution including SSL from ACM.
--created A Record / Alias in Route53 with Cloudfront dns entry.
Generated dashboard-embed-url
AWS CLI command
aws quicksight get-dashboard-embed-url --aws-account-id 00000000000 --dashboard-id "xxxxxxx-xxxxxxx-xxxxxxx-xxxxxxx-xxxxxxx" --identity-type "IAM"
Used this Embedded / signed Url in dashboard.html in "signed URL"
Upload dashboard.html on s3 bucket.
Webpage is ready
Now webpage is available with quicksight dashboard from whitelisted domain.
https://dashboard.mydomain.com.au/dashboard.html

Angular-ui-router templateUrl not working with Chrome and IE, but works for Firefox

Created a very simple Angular ui-router files to test, I found out "templateUrl" ('contact' state in my example code) in the stateProvider not working with Chrome and IE, but works for Firefox, however, 'template'('home' state in my example code) property works in Chrome/IE/Firefox.
My test project only contains two html files under same folder:
index.html
<html>
<head>
<script src="http://unpkg.com/angular#1.5/angular.js"></script>
<script src="http://unpkg.com/angular-ui-router#1.0.0-beta.3/release/angular-ui-router.js"></script>
</head>
<body ng-app="main-app">
<a ui-sref="home">Home</a>
<a ui-sref="contact">Contact</a>
</br>
<ui-view></ui-view>
</body>
<script>
var myApp = angular.module('main-app', ['ui.router']);
myApp.config(function($stateProvider) {
var homeState = {
name: 'home',
url: '/home',
template: 'hello world!'
}
var aboutState = {
name: 'contact',
url: '/contact',
templateUrl: 'contact.html'
}
$stateProvider.state(homeState);
$stateProvider.state(aboutState);
});
</script>
</html>
contact.html
Phone: 416-1113333
There is nothing wrong with your example, it seems you are trying to serve the app via file:// protocol but browsers like Chrome does not allow XHR calls when using the file:// protocol.
Here is the same example accessible via the HTTP server that works identically across browsers.
Another options would be:
embed templates in your index.html file using the <script> directive:
http://docs.angularjs.org/api/ng.directive:script so your templates
are downloaded with the main HTML file and it is no longer necessary
to load them via XHR
change browser settings to allow XHR calls over the file://
protocol. For example, for Chrome follow this answer for a more details

API request from front-end using sails.io.js

I have a basic front-end (html, css, jquery) and I'd like to use sails.io.js to communicate with an API server (developped with sails, with cors enabled). The API is running on localhost:10000 but it will be on an another domain than the one of the webclient later on.
Directly from jquery, I can issue some get request to this API and get the expected results.
When it comes to websocket, I have some problems...
In the index.html (just to test), I put the following:
<script src="js/sails.io.js"></script>
<script type="text/javascript">
io.sails.url('http://localhost:10000');
io.socket.get('/data', function serverResponded (body, sailsResponseObject) {
// body === sailsResponseObject.body
console.log('Sails responded with: ', body);
console.log('with headers: ', sailsResponseObject.headers);
console.log('and with status code: ', sailsResponseObject.statusCode);
});
</script>
But Chrome's developer tools tell me
ReferenceError: io is not defined
Any idea ?
UPDATE
I'm serving index.html with a web server (python -m SimpleHTTPServer)
I've installed sails.io.js using bower.
I've try to make this test as simple as possible:
index.html
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<script src="bower_components/sails.io.js/dist/sails.io.js"></script>
<script src="index.js"></script>
</body>
</html>
index.js:
window.onload=function(){
io.sails.url = 'http://localhost:10000';
io.socket.get('http://localhost:10000/data', function (body, response) {
console.log('Sails responded with: ', body);
});
};
My sails (0.9.16) API is only returning a json object on the GET /data route.
I have implemented a dummy __getcookie function in the api:
'get /__getcookie': function(req, res, next){
res.json({ok: 123});
}
And commented the line 481 in interpret.js (Scott comments below).
I have also modify config/socket.js with:
authorization: false,
=> I can now get the result from the /data route of my API :)
But... on each request I have the following error:
error: Error: No valid session available from this socket.
First of all, sails.io.js includes the code for socket.io.js, so there is no need to try and include that separately. You should remove this line:
<script src="bower_components/socket.io/lib/socket.js"></script>
Next, if you're just loading index.html from disk (rather than serving it from a web server), you'll need to tell the Sails socket client what URL to connect to:
io.sails.url = 'http://localhost:10000';
Put this anywhere before you start making socket calls; the library is smart enough to wait until its connected before trying to make the calls. So, altogether:
window.onload=function(){
io.sails.url = 'http://localhost:10000';
io.socket.get('http://localhost:10000/data', function (body, sailsResponseObject) {
console.log('Sails responded with: ', body);
console.log('with headers: ', sailsResponseObject.headers);
console.log('and with status code: ', sailsResponseObject.statusCode);
});
};
should work. You should be able to see in the console whether or not the socket connected by looking for the "io.socket connected successfully." message.
did you try with a / in front of the src, like:
< script src="js/sails.io.js">
Do you have the sails.io.js in the /assets/js/ folder (sails 0.10) or in the /assets/linker/js folder (sails 0.9 and below).
Did sails lift copied that js file to .tmp/public/js folder?
Where is your index.html file located?

Resources