I'm learning how YouTube player works with Javascript. I have this code because I want to make a video gallery and it works perfectly in any browser (the idea is to switch between videos by the ID), the problem is when I try to test in on my ipad it doesn't display anything. Any suggestions for iOS?
Thanks in advance!
swfobject.embedSWF("http://www.youtube.com/v/3sL8aaMw7ZQ?enablejsapi=1&rel=0&fs=1",
"ytplayer-temp",
"400",
"226",
"10.1",
false,
false,
{ allowScriptAccess: "always", allowFullScreen: "true" },
{ id: "ytplayer" }
);
function ytplayer_loadvideo(id) {
var o = document.getElementById("ytplayer");
if (o) {
o.loadVideoById(id);
}
}
No flash support for iOS. You have to use html5 instead.
https://developers.google.com/youtube/getting_started
Related
please I am looking for a way to use JW Player with ReactJS.
I have implemented it in the best form i could think possible but i keep getting an error that says jwplayer is not a function.
My Implementation
var jwplayer = require('../../../assets/plugins/jwplayer-7.6.1/jwplayer.js');
loadPlayer(){
var {ui} = this.props;
var {camera} = ui;
jwplayer(this.state.playerEl).setup({
sources: [{
file: camera.src,
}],
streamer: camera.streamname,
provider: 'rtmp',
aspectRation: '16:9',
width: '100%',
rtmp: {
bufferlength: 3
},
});
}
The loadPlayer() function is actually in a component where I call it from the componentDidMount()method.
Thanks in advance.
According to https://code.google.com/p/chromium/issues/detail?id=223639 chromium has issues with audio Loopback. and it never works in chrome app. Can anyone share some links and explanation to why is this not working?Or if it is possible? I tried below code but lot of disturbance in desktop audio.
video: {
mandatory: {
chromeMediaSource:'screen',
chromeMediaSourceId: id
}
},
audio: {
mandatory: {
chromeMediaSource: 'system',
chromeMediaSourceId: id,
}
}
Multiple streams are captured and attached to a single peer connection?
Thanks!
AFAIK only desktopCapture API are supporting audio+tab.
chromeMediaSource value must be desktop.
video: {
mandatory: {
chromeMediaSource:'desktop',
chromeMediaSourceId: 'sourceIdCapturedUsingChromeExtension'
}
},
audio: {
mandatory: {
chromeMediaSource: 'desktop',
chromeMediaSourceId: 'sourceIdCapturedUsingChromeExtension'
}
}
Try following demo on Chrome-Canary:
https://rtcmulticonnection.herokuapp.com/demos/Audio+ScreenSharing.html
However make sure to enable chrome://flags#tab-for-desktop-share flag.
I am using this example Recorder.js Demo for recording audios. It's working fine in Linux, but when I use it on Windows. It gives the alert "Error getting audio", For this code is as below
function initAudio() {
//Some code
navigator.getUserMedia(
{
"audio": {
"mandatory": {
"googEchoCancellation": "false",
"googAutoGainControl": "false",
"googNoiseSuppression": "false",
"googHighpassFilter": "false"
},
"optional": []
},
}, gotStream, function(e) {
console.log("In gotStream function :" +e);
alert('Error getting audio');
console.log(e);
});
}
Any thoughts on this?
I have resolved my problem. The problem is that Chrome has recently changed to require secure origins for all powerful APIs, in particular getUserMedia. I have to run this on https://host not on http://host, otherwise getUserMedia will be failed.
I have a problem which is probably easy to solve but i has not yet found a solution. I try to initialize Flowplayer with the OVA (Ad management) plugin. If I set the parameter "autoPlay" = false on a clip the player won't autoplay on initialization. Just as I wan't it. However, if I have, let's say a pre-roll, managed by the OVA plugin it will play once you hit the Play button. But once the pre-roll has finished the main clip won't autoplay. The user has to hit "Play" again.
So the question is: How do I use Flowplayer with OVA and the player shouldn't autoplay until the user hits "Play" but once a pre-roll (or any other ad) has played it should continue to the next clip?
flowplayer( "elementID", "flowplayer.commercial-3.2.15.swf",
{
clip:
{
url: "video.mp4",
autoPlay: false
},
plugins:
{
ova:
{
url: "ova.swf",
ads:
{
schedule:
[
{
position: "pre-roll",
server:
{
type: "direct",
tag: "vast.url"
}
}
]
}
}
}
}
);
Maybe it's too late for a response, but for the ones visiting this post henceforth, the answer is to put autoPlay:false inside the "ova" object, instead of the "clip" one:
ova: {
url: "ova.swf",
autoPlay: false,
// ----- "general" options here -----
}
I'm trying to pass data from Flash to Javascript via ExternalInterface.
It works fine when I'm testing on my localhost, but when I tried to set a website at IIS, so my coworkers could test my application, like: http://192.168.0.10/MyApp, I getting this error:
Error calling method on NPObject.
After reading some questions at Stackoverflow I tried to set allowScriptAccess="always" at my embed tags and Security.allowDomain(*) at my AS file, but it still doesn't work.
I'm using swf object if that matters.
What am I missing?
EDIT: The error occurs when I try to call a method from js to my swf. This is the code adapted to the answer bellow.
var swfReady = false;
swfobject.embedSWF("swf/1.swf", "flashContent", "300", "250", "11", "expressInstall.swf", null, { allowScriptAccess: "always" } , null, function (e) {
if (e.success) {
setTimeout(function () {
swfReady = true;
}, 150);
}
});
btnConfig.on('click', function () {
if (swfReady) {
flashContent.myMethod();
} else {
alert("Hold on...");
}
});
This works great at localhost but when someone try to view the same page through my IP, I get the Javascript error Error calling method on NPObject.
Sometimes this happens when the swf is not ready. You can try the callback function in embedSWF. Don't invoke any swf method until this callback. In addition to this sometimes you will need a few milliseconds of delay.
swfobject.embedSWF("sample.swf", "swfdiv", "400", "300", "9.0.0", "expressInstall.swf", null, null, null, function (e) {
if (e.success) {
console.log("swf ready ");
setTimeout(function(){
// call swf method here
}, 150);
} else {
console.log("embedding failed");
}
});