- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hii..
I want to create a video chat app using WebRTC concept in intel XDK. I have done sample of video streaming. I have created two buttons : One button will take the video and other will paused the video. This sample works well in the emulator but neither testing nor after building the app. Please help me as soon as possible.
The following is the code :
JAVASCRIPT CODE :
main.js
function playVideo()
{
var media = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || null;
var video_audio_properties = {video: true, audio: true};
if(media !== null)
media(video_audio_properties, onSuccess, onError);
else
alert("not supported");
function onSuccess(stream)
{
document.getElementById("videoID").src = window.URL.createObjectURL(stream);
document.getElementById("videoID").play();
}
function onError(error)
{
console.log("Video capture error: ", error.code);
}
}
function pauseVideo()
{
document.getElementById("videoID").pause();
}
HTML CODE :
<!DOCTYPE html>
<html>
<head>
<title>Blank Cordova Mobile App Project Template (Lite)</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<style>
@-ms-viewport { width: 100vw ; zoom: 100% ; } @viewport { width: 100vw ; zoom: 100% ; }
@-ms-viewport { user-zoom: fixed ; } @viewport { user-zoom: fixed ; }
</style>
<script src="cordova.js"></script>
<script src="js/app.js"></script>
<script src="xdk/init-dev.js"></script>
<script src="js/main.js"></script>
</head>
<body>
<div>
<video id = "videoID" style="height:200px; width:200px; border : solid 1px aqua;"></video>
</div><br>
<button id="btn1" onclick = "playVideo();">Play Video</button>
<button id="btn2" onclick = "pauseVideo();">Pause Video</button>
</body>
</html>
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We have a WebRTC chat sample app you can check out. It ships with the XDK and is called 'WebRTCSDK Video Chat Sample'.
Or here is the git repo: https://github.com/gomobile/sample-webrtc-chat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have built the webRTC sample app, however once I am logged in with my Yahoo account it is asking for a Connectto Friend ID, how should I create the IDs?
Pls assist
Arif
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page