Unable to Play Video or Media related Files in Testcafe with Javascript - browser

Video Related scripts are not getting played using testcafe.
Click on Play button - Success
Play video - (It is just loading)
Is there any workaround to make video play using testcafe?

I cannot reproduce your case with this test:
fixture`Fixture`
.page`https://www.devexpress.com/products/testcafestudio/`;
test('test', async (t) => {
await t.switchToIframe('iframe')
await t.click('.ytp-large-play-button.ytp-button.ytp-large-play-button-red-bg')
await t.debug();
})
It works fine. Please share a simple sample. If you don't want to share your example here, you can do it with a template on GitHub. Try to follow this instruction when creating an example.

Related

detect youtube full screen in chrome extension

I have a Chrome extension, which detects Youtube videos and gets their category via the Youtube API as follows:
background.js
chrome.webRequest.onBeforeRequest.addListener(function(details) {
var PageInfo = new URL(url);
if(PageInfo.host=="www.youtube.com")
getCategory(PageInfo); //returns category number via the Youtube API
});
The problem I'm facing is that this does not work if Youtube is in full screen mode. For example after I load a video normally, I change to full screen and pick a video from the suggested videos after the initial one has finished playing. I then cannot get the extension to correctly pick up that new video.
Any tips would be appreciated. Thanks.

Not able to see MediaStream properties value in console

I am totally new to WebRTC and Node.js I was trying to build sample webRTC app using the tutorial http://www.tutorialspoint.com/webrtc/webrtc_media_stream_apis.htm
I have followed exactly the same steps except that I have created my own Nodejs server using nodejs tutorial from same site. As mentioned in webrtc tutorial I am not able to see properties value of MediaStream in console . In my case its totally blank. Is anything I am doing wrong. My file is running on http://127.0.0.1:8081/index.html and I am able to see my local video .
Yes, you should be able to see this. Try this:
In your browser, open a new empty tab, right-click and pick Inspect Element.
Go to the Console tab, paste in the following, and hit Enter: navigator.mediaDevices.getUserMedia({video: true}).then(stream => console.log(stream)).catch(e => console.error(e))
Select to share your camera.
You should see something like this (varies a bit by browser still):
MediaStream {id: "JFK9GaWaTxPptJVuKjNlj9lmfvNarWaXANjv", active: true, onactive: null, oninactive: null, onended: null…}
Note: Always be cautious about people on the internet telling you to paste things into console. :)

Need help for audio conference using Kurento composite media element in Nodejs

I am refereeing the code from GitHub for audio AND video conference using Kurento composite media element, It work's fine for audio AND video streaming over WebRTC.
But I need only audio conference using WebRTC, I have added changes in above GitHub code and new code is uploaded on GitHub Repository.
I have added below changes in static/js/index.js file
var constraints = {
audio: true, video: false
};
var options = {
localVideo: undefined,
remoteVideo: video,
onicecandidate : onIceCandidate,
mediaConstraints: constraints
}
webRtcPeer = kurentoUtils.WebRtcPeer.WebRtcPeerSendrecv(options, function(error) {
When I am running this code, no error for node server as well as on chrome console. But audio stream does not get start. It only showing spinner for long time. Chrome console log is here.
As per reply for my previous stack overflow question, We need to specify MediaType.AUDIO in java code like below
webrtc.connect(hubport, MediaType.AUDIO);
hubport.connect(webrtc, MediaType.AUDIO);
But I want to implementing it in Nodejs using kurento-client.js, I did not get any reference to set MediaType.AUDIO to connect with hubPort and webRtcEndpoint in Nodeja API.
Please someone can help me to do code changes for same in Nodejs or suggest me any reference so I can implement only audio conference using composite media element and Nodejs.
This should do
function connectOnlyAudio(source, sink, callback) {
source.connect(sink, "AUDIO" , function(error) {
if (error) {
return callback(error);
}
return callback(null);
});
}
We are in the process of improving the documentation of the project. I hope that this will all be made more clear in the new docs.
EDIT 1
It is important to make sure that you are indeed sending something, and that the connection between your client and the media server is negotiated correctly. Going through your bower.json, I've found that you are setting the adapter dependency as whatever, so to speak. In the latest releases, they've done some refactoring that makes the kurento-utils-js library fail. We haven't yet adapted to the new changes, so you need to fix the dependency of adapter.js like so
"adapter.js": "v0.2.9"

How to Play Youtube Videos In Windows phone 8 application? and make application Resolution compatible

Hello I am developing a windows phone 8 application. My application is complete i am left with two things
first, i have to play videos from youtube channel.
second, i have to make application resolution compatible.
I visited so many pages but no luck.
can someone help me out, My deadline for application submission is near.
You should add MyToolkit.Extended package from NuGet.
try
{
var videoUri = await MyToolkit.Multimedia.YouTube.GetVideoUriAsync(
"uRs4hz1YEQc", MyToolkit.Multimedia.YouTubeQuality.QualityMedium);
MediaYouTubeVideo.Source = videoUri.Uri;
}
catch (Exception exception)
{
// TODO: Show error
}
Have to say that I have not checked the example, but at least the details on the page suggest that you an use it for playing you tube videos: http://code.msdn.microsoft.com/wpapps/Youtube-Video-Sample-f2692dc9

Scraping youtube mix playlist id for a video

So here is what I am trying to do:
The app in question that this problem is regarding is here: https://github.com/viperfx/ng-juketube, to give everyone some context. So I am loading a youtube video in the background using the youtube Iframe API giving it a youtube video id. That works well. Next, I want to find out the playlist ID of the youtube mix's that appear sometimes on the sidebar.
Current solution:
I am using nodejs in the backend to scrape the youtube video page, and then look in the sidebar for the string 'Youtube Mix'. When I am running my server locally this works well. However when I am running the app from heroku I do not get the same results (as in a mix does not show up) because I am assuming the youtube server and the IP address I have are affecting youtube mix from showing up.
So my question is how can I obtain the youtube mix playlist id using the client (browser) rather than the server?
I have tried things like trying to load the youtube page as an iframe - does not work. iframes only allowed for /embed*
So here is how I solved this issue.
Using a service called http://www.corsproxy.com/ I was able to scrape youtube and get the playlist id using client side code. Here is a snippet from my code showing the solution:
$.get('http://www.corsproxy.com/www.youtube.com/watch?v='+newVal.videoId,function(response) {
var doc = new DOMParser().parseFromString(response, 'text/html');
$scope.mixId = doc.querySelector('.related-playlist').getAttribute('href').split('list=')[1];
$scope.$apply();
});

Resources