Angular 8 catch output events of video in iframe (play, pause, end) - iframe

I have an iframe in my angular application to which I pass the url of a video as [src].
This is the code for the iframe:
<iframe id="videoId" name="videoName"
title="video player" class="video-player video-player-responsive" type="text/html" width="100%"
height="100%" frameborder="0" allowFullScreen allowTransparency="true"
[src]="element.value.url +'&GAOn=true&GAProgressInterval=25'| safe"
style="position:absolute;top:0;left:0;"></iframe>
I want to catch the output events of play, stop and end.
I've tried this way, adding the outputs for onplaying, on pause, onended:
<iframe id="videoId" name="videoName"
title="video player" class="video-player video-player-responsive" type="text/html" width="100%"
height="100%" frameborder="0" allowFullScreen allowTransparency="true"
[src]="element.value.url +'&GAOn=true&GAProgressInterval=25'| safe"
style="position:absolute;top:0;left:0;" (onplaying)="handleVideoPlayEvent($event)"
(onpause)="handleVideoPauseEvent($event)" (onended)="handleVideoEndEvent($event)"></iframe>
But the methods are not called. I've also tried with (play), (pause) and (ended) but it doesn't work.

Related

Why do I get an error in my HTML canvas in this asp.net program?

I'm trying to put an HTML CANVAS in my website.
This is my code Lines but I have an error
"CS1026: ) exepted"
and I don't really know why.
<asp:TableCell runat="server" onload="init();" >
<canvas id="canvas" width="640" height="480" style="background-color:#FFFFFF"></canvas>
<%--<object width="640" height="480"><embed src="../Images/Animations/animation-pharmacie.swf" width="640" height="480" /></object>--%>
</asp:TableCell>

Can't reference iFrame in code behind file

I've got an iFrame in an aspx marked as runat="server". But for some reason I can't reference it in the code behind file.
This is how it's declared in the aspx.
<iframe ID="iFrame" runat="server"></iframe>
This is where it throws an error in the code behind:
iFrame.Attributes["src"] = strUrl + strFile.Split('.')[0] + ".html";
The error is "The name 'iFrame' does not exist in the current context"
Anyone know why I can't reference it?
Where is your iframe embedded?
Having this code
<body>
<iframe id="iFrame1" runat="server"></iframe>
<form id="form1" runat="server">
<div>
<iframe id="iFrame2" runat="server"></iframe>
</div>
</form>
I can access with iFrame1.Attributes["src"] just to iFrame1 and not to iFrame2.
Alternatively, you can access to any element in your form with:
FindControl("iFrame2") as System.Web.UI.HtmlControls.HtmlGenericControl

Targeting a frame in frameset

I am working with framesets for an internet browser-based application that will be running on a local machine. I would like when an image is clicked to target another frame where details will appear. I tried to include "target=details" at the end of the image source as follows but that produced a sytax error:
IMAGE code in gallery.php:
<a href=details.php?c_id=<?php echo $c_id ?> ><img src="./images/<?php echo $row['cfilename'] target=details;?>" width="100" height="100" alt="" />
FRAMESET in index.php:
<FRAMESET ROWS="17%,*">
<FRAME SRC="titlebar.php" NAME=TITLE SCROLLING=NO>
<FRAMESET COLS="26%,30%,*">
<FRAME SRC="sidebar.php" NAME=sidebar TARGET=gallery>
<FRAME SRC="gallery.php" NAME=gallery>
<FRAME SRC="details.php" NAME=details>
</FRAMESET>
<NOFRAMES>
<H1>Criminal Records Database</H1>
No frames? No Problem! Take a look at our
no-frames version.
</NOFRAMES>
</FRAMESET>
you need to add target="_nameofframe" to the href tag and tell it where to open the new link.
in your case, the href of the gallery images should have the following target="details"
i.e.
<a href=details.php?c_id=<?php echo $c_id ?> ><img src="./images/<?php echo $row['cfilename'];?>" target="details" width="100" height="100" alt="" />

Get src value from bean class in iframe (Dialog not being updated)

My code is below:
<p:commandButton value="test" action="#{myProgram1.test1}" oncomplete="ex2.show()"/>
<p:dialog id="dialog2" widgetVar="ex2" onShow="jQuery('#someId').show();">
<iframe frameborder="0" align="left"
src="#{myProgram1.url}"
name="someName" id="someId" scrolling="auto" width="750"
height="500">
</iframe>
</p:dialog>
I have set the value of url in test1 method. But it's not loading the url from bean class. But if I specify particular url then it is opening.
Add update="dialog2" to your <p:commandButton
So it will look like this :
<p:commandButton value="test" update="dialog2"
action="#{myProgram1.test1}" oncomplete="ex2.show()"/>

Issue adjusting iframe height when opened as popup using ModalPopupextender

I am using a ModalPopupextender Ajax Control to open aspx page in a modal Popup. aspx page is opened in a iframe as shown in below code.The content which is loaded in iframe is dynamic hence I cannot give a fixed height to iframe. I want that I should be able to adjust the height as per the content every time popup is being opened. I have a function to resize the iframe height and I am using that successfully on my other pages where iframe gets populated in the window itself but not able to adjust the height when iframe is opened in a POPUP. I have already tried window onload, iframe onload events without any success.
<asp:ModalPopupExtender ID="ModalPopupExtender2" BackgroundCssClass="transparentBG"
runat="server" CancelControlID="ButtonCancel" OkControlID="ButtonDone"
TargetControlID="btnAddNew" PopupControlID="DivAddWindow" Drag="true" >
</asp:ModalPopupExtender>
<div class="popup_Buttons" style="display: none">
<input id="ButtonDone" value="Done" type="button" />
<input id="ButtonCancel" value="Cancel" type="button" />
</div>
<div id="DivAddWindow" style="display: none;">
<iframe id="IframeEdit" scrolling="no" src="MasterPage.aspx" width="700px">
</iframe>
</div>
I would really appreciate if somebody can lead me the solution to resolve this.
Try this:
<iframe id="IframeEdit" onload="iframeLoaded()" scrolling="yes" src="MasterPage.aspx" width="700px">
</iframe>
following javascript function would get height from the iframe content.
<script type="text/javascript">
function iframeLoaded() {
var iFrameID = document.getElementById('IframeEdit');
if (iFrameID) {
iFrameID.height = "";
iFrameID.height = iFrameID.contentWindow.document.body.scrollHeight + "px";
}
}
</script>
I checked it in even ModalPopupextender, it works.

Resources