1

Topic: Change of a flow of video through Javascript

All greetings! I hope for your help. As I in javascript the beginner also began to study it only.
There is a translation from the camera through a plug-in vlc in html.
<param name = "Src" value = "rtsp://admin:psw@192.168.0.20:554/live2.sdp"/>
<embed id = "vlcEmb" type = "application/x-google-vlc-plugin" version = "VideoLAN.VLCPlugin.2.2.4" autoplay = "yes" loop = "no" controls = "no" volume = "0" width=24 % height=auto
target = "rtsp://admin:psw@192.168.0.20:554/live2.sdp"> </embed>
How to write a script that in a full screen mode there was a flow live1, and in normal live1?
I already tried and so
<script>
if (vlc.video.fullscreen) {
var b = document.querySelector ("Src");
b.setAttribute = ("value", "rtsp://admin:psw@192.168.0.20:554/live1.sdp");
b.setAttribute = ("target", "rtsp://admin:psw1990@192.168.0.20:554/live1.sdp");}
</script>
And so
<script>
if (vlc.video.fullscreen == true) {
var param = document.getElementByName ("Src");
param.src = ' rtsp://admin:psw@192.168.1.20:554/live1.sdp ';
var embed = document.getElementByName ("target");
embed.target = ' rtsp://admin:psw@192.168.1.20:554/live1.sdp ';}
</script>
It is impossible (

2

Re: Change of a flow of video through Javascript

maxjuvefan;
It that for a masterpiece?

document.getElementByName

As getElement s ByName can not work with param and if works returns a collection.
If do not want to use jQuery give to all unique id and use document.detElementById
As to remaining - I will not help you, from video almost did not work.

3

Re: Change of a flow of video through Javascript

detElementById = getElementById
querySelector - does not work, since searches on attribute class instead of name

4

Re: Change of a flow of video through Javascript

mage.lan;
And how to use jQuery?

5

Re: Change of a flow of video through Javascript

maxjuvefan;
Approximately so

<script src = "https://code.jquery.com/jquery-3.1.1.min.js"> </script>
<script>
if (vlc.video.fullscreen)
{
$(' param [name = "Src"] ').attr (
' value ';
' rtsp://admin:psw@192.168.0.20:554/live1.sdp'
).attr (
' target ';
' rtsp://admin:psw1990@192.168.0.20:554/live1.sdp'
);
}
</script>

6

Re: Change of a flow of video through Javascript

Yours 2 a piece

<script>
if (vlc.video.fullscreen == true)
{
$(' param [name = "Src"] ').attr (
' src ';
' rtsp://admin:psw@192.168.0.20:554/live1.sdp'
);
$(' #vlcEmb ').attr (
' target ';
' rtsp://admin:psw@192.168.1.20:554/live1.sdp'
);
}
</script>