1. Technical Field
Embodiments of the present disclosure relate to electronic devices and methods for playing images, and more particularly to an electronic device and a method for playing real-time images in a virtual reality.
2. Description of related art
When a real-time image is played in a virtual reality, a media player that plays the real-time image must support a format of the real-time image. In this process, the real-time image is usually converted into an image format that is supported by the media player. Such conversion requires the media player to have more hardware.
In general, the word “module”, as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language, such as, Java, C, or assembly. One or more software instructions in the modules may be embedded in firmware, such as in an EPROM. The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of non-transitory computer-readable medium or other storage device. Some non-limiting examples of non-transitory computer-readable media include CDs, DVDs, BLU-RAY, flash memory, and hard disk drives.
The electronic device 1 includes a storage device 12, at least one processor 14, and a display screen 20. The electronic device 1 may be a smart phone, a personal digital assistant, a graphics tablet, or a tablet personal computer.
The web server 3 is either hardware (e.g., a computer), software (e.g., a computer application), or a combination of both hardware and software that helps to deliver web content that can be accessed through the Internet. In the embodiment, the web server 3 obtains a real-time image from the IP camera 4, and divides the real-time image into a sequence of static pictures.
The IP camera 4 captures one or more real-time images of a scene, and changes a format of each of the real-time images into a Motion Joint Photographic Experts Group (MJPEG) format. The scene may be a supper market, a road intersection, or any other place to be monitored.
The storage device 12 may include any type(s) of non-transitory computer-readable storage medium, such as a hard disk drive, a compact disc, a digital video disc, or a tape drive. In the embodiment, the storage device 12 stores computerized codes of the image playing system 10 and a web browser 16.
The at least one processor 14 may include a processor unit, a microprocessor, an application-specific integrated circuit, and a field programmable gate array, for example.
The web browser 16 is a software application configured for retrieving, presenting, and traversing information resources on the Internet.
The web browser 16 is embedded with a Virtual Reality (VR) client 18. The VR client 18 is a Virtual Reality Modeling Language (VRML) viewer that displays a virtual environment of the scene on the display screen 20 by playing the real-time images from the IP camera 4. In the embodiment, the VR client 18 may be a VRML software component that is embedded in the web browser 16.
In one embodiment, the image playing system 10 includes a plurality of function modules (see
In step S200, the first notification module 100 obtains a real-time image of a scene captured from the IP camera 4 according to a request sent to the IP camera, and notifies the VR client 18 of the electronic device 1 to send the request to the web browser 16 of the electronic device 1. The real-time image is obtained by requesting the IP camera 4 to obtain the real-time image through the network 2.
In step S202, the first triggering module 102 triggers the web browser 16 to send the request to the web server 3 through the network 2. In the embodiment, the web browser 16 sends the request to the web server 3 by means of a technique of Asynchronous JavaScript And XML (AJAX). The technique of AJAX is usually used to create an asynchronous web application which can be used to send data, or retrieve data from the web server 3 without interfering with a display of web pages. In the embodiment, by means of the technique of AJAX, the VR client 18 can play the real-time image continuously, and does not slow down a loading speed for displaying the web pages.
In step S204, the second notification module 104 notifies the web server 3 to obtain the real-time image from the IP camera 4. In one embodiment, the format of the real-time image is Motion Joint Photographic Experts Group (MJPEG) format. The real-time image is captured by the IP camera 4, and the IP camera 4 converts the real-time image to the MJPEG format.
In step S206, the second notification module 104 notifies the web server 3 to divide the real-time image into a sequence of static pictures.
In step S208, the second triggering module 106 triggers the web server 3 to send the sequence of static pictures to the web browser 16.
In step S210, the third notification module 108 notifies the web browser 16 to send the sequence of static pictures to the VR client 18.
In step S212, the third triggering module 110 triggers the VR client 18 to play each of the sequence of static pictures to present the real-time image on the display screen 20.
In step S214, the determination module 112 determines whether there is another request for obtaining the real-time image from the IP camera 4. If there is another request for obtaining the real-time image from the IP camera 4, the procedure repeats the step 200 to the step 214. Otherwise, if there is no request for obtaining the real-time image from the IP camera 4, the procedure ends.
As described above, from the step S200 to the step S214, the VR program 18 obtains the real-time image just through a URL provided by the web server 3, and directly plays the real-time image in a virtual reality, so as to avoid opening a media player of the electronic device 1 to play the image.
Although certain embodiments of the present disclosure have been specifically described, the present disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the present disclosure without departing from the scope and spirit of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
101121625 | Jun 2012 | TW | national |