Why this error : cannot load m3u8 crossdomain access denied (JWplayer 7.12.6) - jwplayer7

I am facing the issue with Jwplayer(7.12.6) to loading .m3u8 video and getting this error message "cannot load m3u8 crossdomain access denied".
And lot of R&D I found replace the url like
{file: "https://content.jwplatform.com/manifests/xxxxxx.m3u8"}
To
{file: "https://cdn.jwplayer.com/manifests/xxxxxx.m3u8"}
but the issue has been resovled some of the user system browser. now other user having same issue. still we can not replicate that issue on particular video.
We are using below code to play video of jwplayer
jwplayer("video416").setup({
sources: [
{file: "https://cdn.jwplayer.com/manifests/xxxxxx.m3u8"},
{file: "https://content.jwplatform.com/videos/XXXXX.mp4"}
],
image: "https://s3.us-east-2.amazonaws.com/university-video- cdn/Containers_101_img.jpg",
autostart: false,
controls:true,
controlbar:true,
displayclick:'play' ,
icons: 'false',
width: '100%',
height: '100%',
primary: "HTML5"
});
Can you please suggest how to allow or any sotuion to optimize this issue for JWplayer(7.12.6).

There is no need to write your own sources: [ ] array for videos that you are hosting on your JW Player account. My suggestion would be to request the JSON URL from their Delivery API. It contains all the metadata (multiple sources, title, image, etc) that they know about this video:
jwplayer("video416").setup({
playlist: '//cdn.jwplayer.com/v2/media/xxxxxxx',
image: "https://s3.us-east-2.amazonaws.com/university-video-cdn/Containers_101_img.jpg",
autostart: false,
controls:true,
controlbar:true,
width: '100%',
aspectratio: '16:9',
primary: "HTML5"
});
And you should use aspectratio instead of height since most web browsers will not like height set to 100%
You can read more about their Delivery API at https://developer.jwplayer.com/jw-platform/docs/delivery-api-reference/

Related

Avoid pops and clicks whilst recording HTML Audio

I am building an app that allows the user to record a message with the microphone and am using a node package called mic-recorder-to-mp3. The constructor takes a bit-rate setting which is currently 128 (which should be more than sufficient for voice recording).
We've started collecting recordings with this app and some are fine, but others are really awful with loud clicks and pops.
I understand that the sample-rate cannot be set and is based on the hardware you're using, but is there something else I am missing? Is that bit rate too high? Do I need to set more memory to the AudioBuffer? Any advice greatly appreciated.
I have discovered to my delight that you can now set constraints when you call getUsermedia which could improve the audio recording quality. They are in the web audio specs as MediaTrackConstraints: https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints
and usage:
export const audioTrackConstraints = {
echoCancellation: {exact: false},
autoGainControl: {exact: false},
noiseSuppression: {exact: false},
sampleRate: 16000,
}
navigator.mediaDevices.getUserMedia({ audio: audioTrackConstraints})
.then(() => {
console.log('Permission Granted');
})
.catch((error) => {
console.log(error.message);
})

when using C3 library, csv file couldn't be loaded

I tried this sample code, but csv file can't be read.
I put the csv file in the exact location. (same with the directory of index.html)!
Not with csv file (with array data), it perfectly works.
Has the grammar rule changed or is there a mistake in the code?
If anyone can check if this code works or can help me anyhow, It'll be really appreciated.
var chart = c3.generate({
data: {
url: '/data/c3_test.csv',
type: 'line'
}
});
setTimeout(function () {
chart.load({
url: '/data/c3_test2.csv'
});
}, 1000);
setTimeout(function () {
chart.load({
columns: [
['data1', 130, 120, 150, 140, 160, 150],
['data4', 30, 20, 50, 40, 60, 50],
],
unload: ['data2', 'data3'],
});
}, 2000);
setTimeout(function () {
chart.load({
rows: [
['data2', 'data3'],
[120, 300],
[160, 240],
[200, 290],
[160, 230],
[130, 300],
[220, 320],
],
unload: 'data4',
});
}, 3000);
Maybe you are loading the model using either file:// or C:/, which stays true to the error message as they are not http://.
You can confirm that this is the error message that you're getting on your browser's console. But I did what you asked and I got the "Fetch API cannot load file:///C:/data.csv. URL scheme must be "http" or "https" for CORS request." and the csv file could not be loaded either.
So you can either install a webserver in your local PC or upload the model somewhere else and change the url to http://somehost/path/to/file
As an alternative, If you're using Chrome, you can try starting it from the terminal with the --allow-file-access-from-files
Browsers don't allow file:// URLs with ajax calls (for security reasons). You need to load your web page through a web server and make your ajax request through that web server using http:// or https://, not file://

Yammer embed open-graph feed for object, not an url?

Is it possible to create an open-graph url for object which is not a www url? Like for network drive location for example?
I tried it and the embed feed seems to only load for www urls.
Here are my questions:
Is it possible to not use a normal www url for the object?
Where is the documentation what different config options are available for the open-graph?
Where is the documentation for the objectProperties config? I'd like to provide all of them manually and disable the system which tries to fetch them through embed.ly or what ever.
This works fine:
yam.connect.embedFeed({
container: "#embedded-feed",
network: "m-files.com",
feedType: "open-graph",
objectProperties: {
url: "https://www.microsoft.com",
type: "file",
title: "Yammer.pdf"
}
});
But for example this doesn't:
yam.connect.embedFeed({
container: "#embedded-feed",
network: "m-files.com",
feedType: "open-graph",
objectProperties: {
url: "\\192.168.1.8\Something\somefile.pdf",
type: "file",
title: "Yammer.pdf"
}
});

Chrome notifications API img

I'm trying to fire a chrome notification ( in a chrome extension ) with the following code:
var opt = {
type: "basic",
title: "Deploy",
message: "It worked!",
iconUrl: "test.png"
};
chrome.notifications.create("", opt, function(id) {
//console.error(chrome.runtime.lastError);
});
But it shows me the following message :
"Unchecked runtime.lastError while running notifications.create: Unable to successfully use the provided image. "
My image "test.png" is in the root folder of my app( with the manifest.json file ), but I've tried to put the picture also in other folder of my app, it never worked!
I've correctly added the permission for notifications, so I really don't know where the problem is !
Any ideas ?
Thank you,
EDIT: I found the solution ! The image needed to be 80*80 !

SWFobject in a Chrome Extension - API Unavaiable

Hi!
I'm building a Chrome extension, in which I need to embed a SWFobject in the background page.
Everything works, except the JavaScript controls for the SWFobject and the eventListeners.
My guess is that it has something to do with the cross-domain policies, because while testing the page on a webserver everything worked fine.
Anyway, here's a snippet:
In the main page:
var playerView = chrome.extension.getBackgroundPage();
$('#playerPause').click(function(){
playerView.playerPause();
});
In the background:
function playerPause() {
if (postData[nowPlaying].provider == 'youtube' ) {
player.pauseVideo();
}
else if (postData[nowPlaying].provider == 'soundcloud' ) {
player.api_pause();
};
}
And the eventListeners:
soundcloud.addEventListener('onMediaEnd', playerNext);
function onYouTubePlayerReady(player) {
player.addEventListener("onStateChange", "function(state){ if(state == 0) { playerNext(); } }");
}
In the console it throws
"Uncaught TypeError: Object # has no method
'pauseVideo'"
for both the Youtube embed the Soundcloud one.
Also, the SWFobject is embedded like this (and works):
function loadTrack (id) {
if(postData[id].provider == 'youtube') {
swfobject.embedSWF(
"http://www.youtube.com/e/" + postData[id].url + "?enablejsapi=1&playerapiid=player",
"player",
"1",
"1",
"8",
null,
{
autoplay: 1
},
{
allowScriptAccess: "always"
},
{
id: "player"
}
);
}
else if(postData[id].provider == 'soundcloud') {
swfobject.embedSWF(
'http://player.soundcloud.com/player.swf',
'player',
'1',
'1',
'9.0.0',
'expressInstall.swf',
{
enable_api: true,
object_id: 'player',
url: postData[id].url,
auto_play: true
},
{
allowscriptaccess: 'always'
},
{
id: 'player',
name: 'player'
}
);
}
}
Sorry for the lengthy post, I wanted to provide as much information as possible.
Also, I know the code isn't pretty, this was only my second application ;)
Thanks a lot in advance to anyone who can help,
Giacomo
You can have a look at this extension, you can not access local connection in chrome extension, but you can run a content script as a proxy script instead.(You can serve a proxy page on gae or any other free servers)
The problem here is that you can't use inline scripts or inline event handlers in chrome extensions ever since the manifest evolved to v2.
You should have added the manifest file for me to understand what's going on better. But briefly all you CAN ever do is
In the main page,
Remove all inline scripts and move them to an external JS file.
Remove inline event listeners, move them to the same or another external JS and use
addEventListener().
But the issue is, You can't execute calls to the swf in the background page or expect it to return anything. All these will continue to give you "Uncaught TypeError" Exception.
Take the case of a webcam image capturing swf, the webcam will be streamed to the page, but the function call to it can never be made and hence the image will never be captured.
My project to scan QR codes from the addons popup met the ruins due to this.