I am working in a project for the front-side.
We have a flash player showing a live video game from external. We have the access by api provided from a third part.
Everything works fine but the big issue now is how to display a simple text "loading" before the stream video starts, this is very necessary because the video delays a bit at the beginning.
I am newbie on it and have made a big search to find something helpful.
I have found a good documentation here and in this page explaining well to how to get external content into my SWF file. But my question is how can i edit my The FlashVars parameter of the HTML when the data is provided by an api?
<div id="flashContent">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" id="FlashVars_AS2" align="middle">
<param name="movie" value="FlashVars_AS3.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#ffff66">
<param name="play" value="true">
<param name="loop" value="true">
<param name="wmode" value="window">
<param name="scale" value="showall">
<param name="menu" value="true">
<param name="devicefont" value="false">
<param name="salign" value="">
<param name="allowScriptAccess" value="sameDomain">
<param name="FlashVars" value="myVariable=Hello%20World&mySecondVariable=Goodbye">
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="FlashVars_AS3.swf" width="550" height="400">
<param name="movie" value="FlashVars_AS2.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#ffff66">
<param name="play" value="true">
<param name="loop" value="true">
<param name="wmode" value="window">
<param name="scale" value="showall">
<param name="menu" value="true">
<param name="devicefont" value="false">
<param name="salign" value="">
<param name="allowScriptAccess" value="sameDomain">
<param name="FlashVars" value="myVariable=Hello%20World&mySecondVariable=Goodbye">
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player">
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
Thus is the code used by example in the Adobe documentation but i can work on it if my data is provided from a third part and it's not a swf?
Hope my explanation is clear and sorry if it's not because i am not expert on it.
Good examples and different solutions are very welcome too
thanks
you should handle NetStatusEvent of your NetStream in video-player
someFunctionShowingLoadingMessage();
stream.addEventListener(NetStatusEvent.NET_STATUS, streamStatusHandler);
private function streamStatusHandler(event:NetStatusEvent):void {
switch (event.info.code) {
case "NetConnection.Connect.Success":
break;
case "NetStream.Play.Start":
break;
case "NetStream.Buffer.Full":
// buffer is full and we may show video
// and hide our simple text "loading..."
break;
case "NetStream.Play.Stop":
break;
case "NetStream.Play.StreamNotFound":
break;
}
}
Related
I want to get mapping to work using a Picamera. I have a Raspberry Pi running a cv_camera_node and an Ubuntu 20.04.1 running roscore, as well as, slam and rviz. I have OpenCV 4.2.0 and installed the following version of orb-slam2: https://github.com/appliedAI-Initiative/orb_slam_2_ros. I am running ROS Noetic. I have wrote the following launch file for slam:
<launch>
<node name="orb_slam2_mono" pkg="orb_slam2_ros"
type="orb_slam2_ros_mono" output="screen">
<param name="publish_pointcloud" type="bool" value="true" />
<param name="publish_pose" type="bool" value="true" />
<param name="localize_only" type="bool" value="false" />
<param name="reset_map" type="bool" value="true" />
<!-- static parameters -->
<param name="load_map" type="bool" value="false" />
<param name="map_file" type="string" value="map.bin" />
<param name="voc_file" type="string" value="/home/dragonros/catkin_ws/src/orb_slam_2_ros/orb_slam2/Vocabulary/ORBvoc.txt" />
<param name="pointcloud_frame_id" type="string" value="map" />
<param name="camera_frame_id" type="string" value="camera_link" />
<param name="min_num_kf_in_map" type="int" value="5" />
<!-- ORB parameters -->
<param name="/ORBextractor/nFeatures" type="int" value="2000" />
<param name="/ORBextractor/scaleFactor" type="double" value="1.2" />
<param name="/ORBextractor/nLevels" type="int" value="8" />
<param name="/ORBextractor/iniThFAST" type="int" value="20" />
<param name="/ORBextractor/minThFAST" type="int" value="7" />
<!-- Camera parameters -->
<!-- Camera frames per second -->
<param name="camera_fps" type="int" value="30" />
<!-- Color order of the images (0: BGR, 1: RGB. It is ignored if images are grayscale) -->
<param name="camera_rgb_encoding" type="bool" value="true" />
<!--If the node should wait for a camera_info topic to take the camera calibration data-->
<param name="load_calibration_from_cam" type="bool" value="false" />
<!-- Camera calibration and distortion parameters (OpenCV) -->
<param name="camera_fx" type="double" value="615.546" />
<param name="camera_fy" type="double" value="631.457" />
<param name="camera_cx" type="double" value="354.361" />
<param name="camera_cy" type="double" value="232.799" />
<!-- Camera calibration and distortion parameters (OpenCV) -->
<param name="camera_k1" type="double" value="0.0" />
<param name="camera_k2" type="double" value="0.0" />
<param name="camera_p1" type="double" value="0.0" />
<param name="camera_p2" type="double" value="1.0" />
</node>
</launch>
Then I run another custom catkin package that has the following python script:
#!/usr/bin/env python
import rospy
import cv2
from cv_bridge import CvBridge
from sensor_msgs.msg import Image
bridge = CvBridge()
def callback(data):
frame = bridge.imgmsg_to_cv2(data, "bgr8")
cv2.imshow('Video Feed', frame)
cv2.waitKey(1)
rospy.loginfo('Image feed received!')
def listener():
rospy.init_node('vid_rec')
#first parameter is the topic you want to subcribe sensor_msgs/Image from
rospy.Subscriber('/orb_slam2_mono/debug_image', Image, callback)
rospy.spin()
if __name__ == '__main__':
listener()
I am supposed to see a camera feed with all the points slam detects. But the /orb_slam2_mono/debug_image has no data. I confirmed that by running rostopic echo /orb_slam2_mono/debug_image. I know that there is a camera feed because both rviz and rqt_image_viewer can display images coming off of /cv_camera/image_raw. I have thoroughly followed this guide: https://medium.com/#mhamdaan/implementing-orb-slam-on-ubuntu-18-04-ros-melodic-606e668deffa. What is the problem and how can I fix it?
Maybe your camera isn't getting picked up. You are using cv_camera_node meaning that the default topic will be cv_camera but orb_slam2 requires just camera. To solve this, go into the cv_camera_node.cpp which will look like this:
// Copyright [2015] Takashi Ogura<t.ogura#gmail.com>
#include "cv_camera/driver.h"
int main(int argc, char **argv)
{
ros::init(argc, argv, "cv_camera");
ros::NodeHandle private_node("~");
cv_camera::Driver driver(private_node, private_node);
try
{
driver.setup();
while (ros::ok())
{
driver.proceed();
ros::spinOnce();
}
}
catch (cv_camera::DeviceError &e)
{
ROS_ERROR_STREAM("cv camera open failed: " << e.what());
return 1;
}
return 0;
}
You will have to change the line that says ros::init(argc, argv, "cv_camera"); into this ros::init(argc, argv, "camera");. Rerun everything and it should work.
I had the same problem, I discovered that the problem was in the launch file, it was remapping the camera feed to a wrong ros topic, if you use the default launch file and open rqt node graph you will see that there's a floating topic with the name camera/rgb/image_raw and since no one is publishing that topic orbslam is not reading your camera feed. to solve this all I had to do was remove this line from the launch file
<!-- remove this -->
<remap from="/camera/image_raw" to="/camera/rgb/image_raw" />
Before fixing the problem ros node graph showed that orbslam wasn't subscribed to the real camera footage, instead it was subscribed to that /rgb topic, but after the fix, it subscribed to the right camera topic.
Before the fix
After the fix
I have a problem with accessing 3 buttons on a webpage since they don't belong to the DOM and I cannot fetch them using ID or any other "anchor". These are ActiveX buttons from what I can see in the DOM tree, but I have no idea how to reach to them.
As for now, the only (stupid) workaround is to loop through all the items using on the page by SendKeys {TAB} and pressing space on each of them. Only those buttons react to the space key, but it's not a reliable solution, so I want find something proper.
I'm attaching the DOM screen from the area where they are placed on the page and the code where I think there are sitting.
<DIV id=divDragDrop style="HEIGHT: 200px; WIDTH: 700px; TEXT-ALIGN: left">
<!-- -------- DRAG/DROP ACTIVEX CONTROL AREA -------- -->
<OBJECT id=DragDropActiveX style="HEIGHT: 200px; WIDTH: 700px; LEFT: 0px; TOP: 0px; VISIBILITY: visible" name=DragDropActiveX codeBase="DragDropControl.dll" classid=clsid:b7e10a13-86c9-43af-9d8a-aa153b0470c8 enableviewstate="true">
<PARAM NAME="ClaimNumber" VALUE="0004887564">
<PARAM NAME="FileNoteNumber" VALUE="D3EFC3275F4ACA9D">
<PARAM NAME="FileNoteCategory" VALUE="COV">
<PARAM NAME="FileNoteSubcategory" VALUE="FNOL1">
<PARAM NAME="FileUploadServiceURL" VALUE="https://xlgc.r02.xlgs.local:443/Desktop/FileNotes/FileAcceptorForDragAndDrop.aspx?UserId=A135604">
<PARAM NAME="AllowedFileTypes" VALUE="doc.gif.htm.html.jpeg.jpg.pdf.rtf.tif.tiff.txt.xls.zip.fdf.xfdf.asp.asf.asx.aiff.au.dwg.dxf.dwf.atd.bmp.cvs.cfm.cfml.cgi.emz.cgm.csv.dec.dib.dcm.dtd.daf.eps.msg.fpx.xml.fos.mif.hdml.pcl.idl.xsf.xsn.one.ppt.mps.mpt.mpw.rmh.vsd.vss.vst.vsw.dot.dgn.mod.mp3.mpg.mpg2.mp4.mxf.pgm.ppm.soc.oft.pcx.pff.php.php3.phtml.pct.png.ps.pro.ptd.mov.ra.rm.ram.rmm.rnx.rv.svg.sct.scm.shtml.spml.stm.spl.swf.sgi.mht.smil.ras.sun.tga.avi.vrf.voc.wrl.wsdl.emf.jnt.wma.wax.wmv.wvx.wmf.wbmp.wpd.xfm.att.rls.rlx.ctm.hhf.mcr.tbr.ent.pen.xsd.elm.xsl.afp.cr2.crw.dita.dng.docm.docx.dotm.dv.eap.emcmf.f4v.flv.gxf.lxf.mdi.mmap.mmas.mmat.mss.odt.opml.pnm.pptx.pub.rle.ump.xlsb.xlsm.xlsx.xmi.pcd.eml">
<PARAM NAME="IsDirty" VALUE="False">
<PARAM NAME="MaxFileSizeInBytes" VALUE="">
<PARAM NAME="DraftVisible" VALUE="True">
<PARAM NAME="AutoSize" VALUE="False">
<PARAM NAME="AutoSizeMode" VALUE="GrowOnly">
<PARAM NAME="AutoValidate" VALUE="EnablePreventFocusChange">
<PARAM NAME="BorderStyle" VALUE="None">
<PARAM NAME="CurrentAutoScaleDimensions" VALUE="6, 13">
<PARAM NAME="AutoScroll" VALUE="False">
<PARAM NAME="AutoScrollMargin" VALUE="0, 0">
<PARAM NAME="AutoScrollMinSize" VALUE="0, 0">
<PARAM NAME="AccessibleDescription" VALUE="">
<PARAM NAME="AccessibleName" VALUE="">
<PARAM NAME="AccessibleRole" VALUE="Default">
<PARAM NAME="AllowDrop" VALUE="False">
<PARAM NAME="Anchor" VALUE="Top, Left">
<PARAM NAME="AutoScrollOffset" VALUE="0, 0">
<PARAM NAME="BackColor" VALUE="233, 238, 255">
<PARAM NAME="BackgroundImage" VALUE="">
<PARAM NAME="BackgroundImageLayout" VALUE="Tile">
<PARAM NAME="CausesValidation" VALUE="True">
<PARAM NAME="Cursor" VALUE="Default">
<PARAM NAME="Dock" VALUE="None">
<PARAM NAME="Enabled" VALUE="True">
<PARAM NAME="Font" VALUE="Arial, 11world">
<PARAM NAME="ForeColor" VALUE="Black">
<PARAM NAME="Location" VALUE="280, 652">
<PARAM NAME="Margin" VALUE="3, 3, 3, 3">
<PARAM NAME="MaximumSize" VALUE="0, 0">
<PARAM NAME="MinimumSize" VALUE="0, 0">
<PARAM NAME="Name" VALUE="DragDropControl">
<PARAM NAME="RightToLeft" VALUE="No">
<PARAM NAME="Size" VALUE="875, 250">
<PARAM NAME="TabIndex" VALUE="0">
<PARAM NAME="TabStop" VALUE="True">
<PARAM NAME="Tag" VALUE="">
<PARAM NAME="UseWaitCursor" VALUE="False">
<PARAM NAME="Visible" VALUE="True">
<PARAM NAME="PreferredSize" VALUE="685, 196">
<PARAM NAME="Padding" VALUE="0, 0, 0, 0">
<PARAM NAME="ImeMode" VALUE="NoControl">
</OBJECT>
<!-- ATTENTION: hDragDropState below is required for DragDropActiveX -->
<INPUT id=ctl00_MainContent_hDragDropState type=hidden name=ctl00$MainContent$hDragDropState>
<!-- ----- END DRAG/DROP ACTIVEX CONTROL AREA ------- -->
</DIV>
Thanks!
i have some old flash games.
They contains:
a .swf file
a folder with files with type 'File'
when i use following code it runs locally but when i upload it on my server online then it doesn't work.
<object type="application/x-shockwave-flash" data="race.swf" id="histo2" style="width:100%; height:100%;float: none; vertical-align:middle">
<param name="movie" value="race.swf" />
<param name="allowfullscreen" value="true" />
<param name="allowScriptAccess" value="always" /><!-- sameDomain -->
<param name="wmode" value="opaque" />
<param name="quality" value="high" />
<param name="menu" value="false" />
<div class="outer">
<div class="middle">
<div class="inner">
<h3>Click below button to enable flash player or to install it.</h3>
<a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
</div>
</div>
</div>
</object>
Read the last EDIT, please.
I have a page in which I should display some media data.
For this I'm using html tag, like this:
<object type="video/x-ms-wmv" width="320" height="240">
<param name="src" value="some_media_url" />
<param name="AutoSize" value="true">
<param name="ShowDisplay" value="false">
<param name="AutoStart" value="false">
<param name="StretchToFit" value="true">
<param name="bgcolor" value="#ffffff" />
</object>
In my case, I should get media data from SQL server by some MediaHandler.ashx http handler.
When I get an audio(.mp3, .wma) or video(.flv, .mp4) stream this works fine.
But I'm getting some problems with .swf flash files.
For this type of files I change <object> type to be "application/x-shockwave-flash". In this case when I use some remote path, like http://www.tizag.com/pics/example.swf, it works fine:
<object type="application/x-shockwave-flash" width="320" height="240">
<param name="src" value='http://www.tizag.com/pics/example.swf' />
<param name="AutoSize" value="true">
<param name="ShowDisplay" value="false">
<param name="AutoStart" value="false">
<param name="StretchToFit" value="true">
</object>
But, it doesn't work with my handler. It neither works with local paths,like "c:\videos\example.swf"
Any idea?
EDIT: Actually src for media looks like this:
<object type="video/x-ms-wmv" width="320" height="240">
<param name="src" value="http://localhost:11111/MediaHandler.ashx?Id=1111" />
<param name="AutoSize" value="true">
<param name="ShowDisplay" value="false">
<param name="AutoStart" value="false">
<param name="StretchToFit" value="true">
<param name="bgcolor" value="#ffffff" />
</object>
EDIT:
This works fine, if I directly refer to an existing file:
<object type="application/x-shockwave-flash" width="320" height="240">
<param name="src" value="/videos/ETFflash1016.swf" />
<param name="AutoSize" value="true">
<param name="ShowDisplay" value="false">
<param name="AutoStart" value="true">
<param name="StretchToFit" value="true">
</object>
But when I use httpHandler to get file from DB:
<object type="application/x-shockwave-flash" width="320" height="240">
<param name="src" value="http://localhost:57031/MediaHandler.ashx?Id=512429" />
<param name="AutoSize" value="true">
<param name="ShowDisplay" value="false">
<param name="AutoStart" value="true">
<param name="StretchToFit" value="true">
</object>
flash is not displayed.
I've compared the output html for these cases, they're the same in both cases (except src param value). Fiddler shows the same result for both requests for .swf file and the browser shows(e.g. in IE dev tool's Netwok tab) that the file was downloaded to client in both cases.
BUT in the case with the handler, flash is not being displayed.
Fiddler shows the same result for both requests for .swf file
In Fiddler, Response Headers, do both the local file and ASHX handler return the same Content-Type: application/x-shockwave-flash ?
try this:
<object type="application/x-shockwave-flash" data="file.swf" style="width:640px;height:480px;margin:10px 36px;">
<param name="movie" value="file.swf" />
<param name="AutoSize" value="true">
<param name="ShowDisplay" value="false">
<param name="AutoStart" value="false">
<param name="StretchToFit" value="true">
<param name="bgcolor" value="#ffffff" />
</object>
it worked for me
I've solved it!
In the handler, I was setting Response Header's parameters the same values as they were in the case with directly referring to an existing file.
Now, I just removed all this values, and it works!
I still can't understand why, but it works :)
I'd like an audio file to play automatically when I open the page.
Here's the code:
<object width="290" height="24" data="http://localhost/placement/theme/anomaly/sound/player.swf" type="application/x-shockwave-flash" id="audioplayer1">
<param name="movie" value="/placement/theme/anomaly/sound/player.swf" />
<param name="FlashVars" value="playerID=1&bg=0xCDDFF3&leftbg=0x357DCE&lefticon=0xF2F2F2&rightbg=0xE66511&rightbghover=0xEF9C10&righticon=0xF2F2F2&righticonhover=0xFFFFFF&text=0x357DCE&slider=0x357DCE&track=0xFFFFFF&border=0xFFFFFF&loader=0xAF2910&soundFile=/placement/theme/anomaly/sound/2.mp3" />
<param name="quality" value="high" />
<param name="menu" value="false" />
<param name="wmode" value="transparent" />
I tried to add the following line:
<param value="true" name="autoplay" />
but it doesn't work. Please help me.
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="590" height="475" ID="Captivate1">
<param name="movie" value="untitled_skin.swf">
<param name="quality" value="high">
<param name="loop" value="0">
<param name="play" value="false">
<embed src="untitled_skin.swf" width="590" height="475" loop="0" quality="high" pluginspage="http://www.adobe.com/go/getflashplayer" type="application/x-shockwave-flash" play="false" flashvars="autoplay=false&play=false" menu="false"></embed>
</object>