WO2015180448A1 - 移动终端播放方式切换方法、装置、存储介质和程序 - Google Patents

移动终端播放方式切换方法、装置、存储介质和程序 Download PDF

Info

Publication number
WO2015180448A1
WO2015180448A1 PCT/CN2014/093640 CN2014093640W WO2015180448A1 WO 2015180448 A1 WO2015180448 A1 WO 2015180448A1 CN 2014093640 W CN2014093640 W CN 2014093640W WO 2015180448 A1 WO2015180448 A1 WO 2015180448A1
Authority
WO
WIPO (PCT)
Prior art keywords
full
screen
video content
view
played
Prior art date
Application number
PCT/CN2014/093640
Other languages
English (en)
French (fr)
Inventor
马妙魁
常小军
Original Assignee
广州市动景计算机科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN201410238962.0A external-priority patent/CN105138311B/zh
Priority claimed from CN201410238712.7A external-priority patent/CN105306997B/zh
Application filed by 广州市动景计算机科技有限公司 filed Critical 广州市动景计算机科技有限公司
Priority to US15/315,269 priority Critical patent/US10643580B2/en
Publication of WO2015180448A1 publication Critical patent/WO2015180448A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G5/00Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
    • G09G5/36Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators characterised by the display of a graphic pattern, e.g. using an all-points-addressable [APA] memory
    • G09G5/38Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators characterised by the display of a graphic pattern, e.g. using an all-points-addressable [APA] memory with means for controlling the display position
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/106Display of layout of documents; Previewing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/60Rotation of a whole image or part thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2200/00Indexing scheme relating to G06F1/04 - G06F1/32
    • G06F2200/16Indexing scheme relating to G06F1/16 - G06F1/18
    • G06F2200/161Indexing scheme relating to constructional details of the monitor
    • G06F2200/1614Image rotation following screen orientation, e.g. switching from landscape to portrait mode
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2320/00Control of display operating conditions
    • G09G2320/08Arrangements within a display terminal for setting, manually or automatically, display parameters of the display terminal
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2340/00Aspects of display data processing
    • G09G2340/04Changes in size, position or resolution of an image
    • G09G2340/0464Positioning
    • G09G2340/0471Vertical positioning
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2340/00Aspects of display data processing
    • G09G2340/04Changes in size, position or resolution of an image
    • G09G2340/0464Positioning
    • G09G2340/0478Horizontal positioning
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2340/00Aspects of display data processing
    • G09G2340/04Changes in size, position or resolution of an image
    • G09G2340/0492Change of orientation of the displayed image, e.g. upside-down, mirrored
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2354/00Aspects of interface with display user
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G5/00Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
    • G09G5/14Display of multiple viewports

Definitions

  • the present invention relates to the field of information processing technologies, and in particular, to a method and an apparatus for switching a play mode of a mobile terminal.
  • the default playback mode is usually a non-full screen mode.
  • non-full screen mode network video is usually played in portrait mode.
  • full screen mode network video is usually played in landscape mode.
  • the mobile terminal needs to switch from the non-full screen mode to the full screen mode, and switch from the vertical screen form to the horizontal screen mode to switch the non-full screen mode in the vertical screen form.
  • the View (view) where the video is located is separated from the WebView (web view), placed on a full-screen View, and the direction attribute (Oritation) in the event is used. ) to rotate the entire WebView to a landscape display.
  • the WebView rotates, causing the browser kernel to re-type.
  • the WebView will once again switch from the horizontal screen to the vertical screen, which will cause the browser kernel to perform another typesetting.
  • the browser kernel typography involves recalculating the coordinates and size of each web page element. Therefore, if the web page is re-typed by the browser kernel in the horizontal and vertical screen switching, it will occupy a lot of hardware resources such as CPU, which further causes the switching speed to slow down. And in the process of re-typesetting, users will see a messy web page with poor user experience.
  • the embodiment of the present application discloses a method for switching a play mode of a mobile terminal.
  • a full-screen blank view is first created, and a full-screen play view is created, so that the full-screen play view covers the full-screen blank view; then the video content to be played is loaded to the full-screen play view; according to the received mobile terminal Rotating the angle, rotating the video content loaded to the full-screen playback view, and playing the rotated video content in the full-screen playback view.
  • FIG. 1 Another aspect of an embodiment of the present invention further discloses a mobile terminal playback mode switching apparatus, including one or more processors, and one or more memories storing computer executable instructions, when the executable instructions are executed When one or more processors perform the following steps: create a full-screen blank view and create a full-screen playback view so that The full-screen playback view covers the full-screen blank view; loading the video content to be played to the full-screen playback view;
  • the video content loaded to the full-screen playback view is rotated according to the received rotation angle of the mobile terminal, and the rotated video content is played in the full-screen playback view.
  • Yet another aspect of an embodiment of the present invention provides a computer readable medium having processor-executable program code for use in a mobile terminal, the program code causing a processor to perform the steps of: creating a full-screen blank view and creating a full-screen playback view, the full-screen playback view is overlaid on the full-screen blank view; the video content to be played is loaded into the full-screen playback view; and the rotation is loaded to the full-screen playback view according to the received rotation angle of the mobile terminal Video content and playing the rotated video content in the full-screen playback view.
  • an embodiment of the present invention further provides a mobile terminal playback mode switching procedure, which has the steps of the foregoing method.
  • the method for switching the playing mode of the mobile terminal realizes switching of the playing mode of the mobile terminal by rotating the video content, and switches the non-full-screen mode in the vertical screen mode to the full-screen mode in the horizontal screen mode, and the video is changed during the switching process.
  • the rendering direction of the content in the full-screen playback view the browser no longer needs to re-type the webpage, reducing the consumption of hardware resources such as CPU caused by the browser kernel re-formatting the current video page due to the switching of the video screen, thereby accelerating Switching processes to make the video play smoothly.
  • the screen display garbled during the video screen switching causing the WebView to display the content of the current video page, which affects the user experience.
  • the application does not need to be re-typed, and there is no garbled, which further improves the user experience.
  • FIG. 1 is a flowchart of an embodiment of a method for switching a play mode of a mobile terminal according to the present disclosure
  • FIG. 2(a) is a schematic diagram of a screen of the mobile terminal in a non-full screen mode
  • FIG. 2(b) is a schematic diagram of a screen of the mobile terminal in full screen mode after the mobile terminal playing mode switching method is applied;
  • FIG. 2(c) is a diagram showing a method for switching a play mode of a mobile terminal according to the present invention, where the mobile terminal is in a full screen mode Screen diagram under the formula;
  • FIG. 3 is a flowchart of still another embodiment of a method for switching a play mode of a mobile terminal according to the present disclosure
  • FIG. 4 is a schematic diagram of an example of loading video content in a method for switching a playback mode of a mobile terminal according to the present disclosure
  • FIG. 5 is a schematic diagram of still another example of loading video content in a method for switching a play mode of a mobile terminal according to the present disclosure
  • FIG. 6 is a flowchart of still another embodiment of a method for switching a play mode of a mobile terminal according to the present disclosure
  • FIG. 7 is a flowchart of still another embodiment of a method for switching a play mode of a mobile terminal according to the present disclosure
  • FIG. 8 is a flowchart of still another embodiment of a method for switching a play mode of a mobile terminal according to the present disclosure
  • FIG. 9 is a block diagram of an embodiment of a mobile terminal playing mode switching apparatus according to the present invention.
  • FIG. 10 is a block diagram of still another embodiment of a mobile terminal playing mode switching apparatus according to the present invention.
  • FIG. 11 is a flowchart of a method for improving graphics rendering efficiency, according to an exemplary embodiment
  • FIG. 12 is a flowchart of a method for improving graphics rendering efficiency, according to an exemplary embodiment
  • FIG. 13 is a flowchart of a method for improving graphics rendering efficiency, according to an exemplary embodiment
  • FIG. 14 is a flowchart of a method for improving graphics rendering efficiency, according to an exemplary embodiment
  • the following embodiments of the present invention provide a method and a device for switching a play mode of a mobile terminal, so as to solve the problem that when the mobile terminal is switched, the video content is re-typed and spends a lot of time, thereby affecting the smooth playback of the video.
  • the method for switching the playback mode of the mobile terminal disclosed in the embodiment of the present application includes:
  • Step 11 Create a full-screen blank view and create a full-screen playback view to make the full-screen playback view cover.
  • the full screen blank view
  • the default playback mode of the mobile terminal is non-full-screen mode. If the user selects the full-screen mode to play the network video, the mobile terminal needs to switch the play mode.
  • the mobile terminal playback mode switching method disclosed in the present application after creating a full-screen blank view, a full-screen playback view needs to be created, and the full-screen playback view is overlaid on the full-screen blank view.
  • Step 12 Acquire video content to be played, and load it into the full-screen playback view.
  • Step 13 Rotate the video content loaded into the full-screen playback view according to the received rotation angle of the mobile terminal, for example, change the rendering direction of the video content in the full-screen playback view to change the direction of the video content, and play the view in the full-screen view. Play the rotated video content in .
  • the video content loaded to the full-screen playback view is rotated according to the received rotation angle of the mobile terminal.
  • the specific value of the rotation angle of the mobile terminal can be set according to the viewing requirement of the user.
  • the video content In the non-full screen mode, the video content is usually in the form of a vertical screen. In the full screen mode, the video content is usually in the form of a horizontal screen. Therefore, in order to switch the video content in the form of a vertical screen to a horizontal screen, the rotation angle of the mobile terminal is usually It is 90 ⁇ 360 degrees or 270 ⁇ 360 degrees.
  • the rotation angle of the mobile terminal may be other values according to the viewing requirements of the user, which is not limited in this application.
  • the playback mode for FIG. 2(a) is a non-full screen mode.
  • the video content is presented in a vertical screen.
  • 2(b) is a full-screen mode, in which case the rotation of the video content has been completed according to the rotation angle of the mobile terminal, and the rotation angle of the mobile terminal is 90 ⁇ 360 degrees, thereby making the video content Rendered as a landscape in the full-screen playback view.
  • 2(c) is a full-screen mode, in which case, in some embodiments, the rotation of the video content is completed according to a rotation angle of the mobile terminal, and the rotation angle of the mobile terminal is 270 ⁇ 360 degrees. So that the video content is rendered as a landscape in the full-screen playback view.
  • the embodiment of the present application discloses a method for switching a play mode of a mobile terminal.
  • a full-screen blank view is first created, and a full-screen play view is created, so that the full-screen play view covers the full-screen blank view; then the video content to be played is loaded into the full-screen play view; after receiving the mobile terminal After the angle of rotation, the video content loaded into the full-screen playback view is rotated, and the rotated video content is played in the full-screen playback view.
  • the method for switching the playing mode of the mobile terminal realizes switching of the playing mode of the mobile terminal by rotating the video content, and switches the non-full screen mode in the vertical screen mode to the full screen mode in the horizontal screen mode, and the browser does not need to be in the switching process.
  • Retype the web page Reduces the consumption of hardware resources such as CPU caused by the browser kernel re-formatting the current video page when the video screen is switched, thereby speeding up the switching process and making the video smooth. Play.
  • the screen display garbled during the video screen switching causing the WebView to display the content of the current video page, which affects the user experience.
  • the application does not need to be re-typed, and there is no garbled, which further improves the user experience.
  • the method for switching a play mode of a mobile terminal disclosed in the present application further includes:
  • Step 14 Rotate the video control bar according to the rotation angle of the mobile terminal.
  • the video control strip is rotated after the operation of step 13 is completed, that is, the rotation of the video content is completed.
  • the video control strip may also be rotated before or at the same time as the video content is rotated, which is not limited in this application.
  • the rotation angle of the video control strip is the same as the rotation angle of the video content, so that the user can know the progress of the video playback when watching the video content in the full screen mode.
  • a determining operation may also be performed, in which it is determined whether the video content loaded in the full-screen playback view is in the form of a vertical screen, and if so, according to the rotation of the mobile terminal The angle rotates the video content to switch from the portrait mode to the landscape mode. If not, the video content is currently in landscape mode, no longer rotated, and can be played directly.
  • step S12 a step of loading the video content to be played to the full-screen playback view is disclosed, the step including various implementations.
  • the step of loading the video content to be played to the full-screen playback view includes:
  • Step 121 Establish a connection relationship between the player and the full-screen playback view through the player interface.
  • Step 122 Acquire, by the connection relationship, the video content to be played included in the player, and load the video content to be played into the full-screen playback view.
  • step 121 to step 122 the player is associated with the full-screen playback view through the player interface, and then the video content contained in the player is acquired and loaded into the full-screen playback view.
  • the step of loading the video content to be played to the full-screen playback view includes:
  • Step 123 Store the video content to be played included in the player into the buffer.
  • Step 124 Copy the video content to be played in the buffer, and load the copied video content into the Play in full screen view.
  • the video content to be played can be loaded into the full-screen playback view.
  • the embodiment of the present application further discloses a method for switching a play mode of a mobile terminal.
  • the method includes:
  • Step 21 Create a full-screen blank view, and create a full-screen play view, so that the full-screen play view covers the full-screen blank view.
  • Step 22 Load video content to be played to the full-screen playback view.
  • Step 23 Rotate the video content loaded into the full-screen playback view according to the received rotation angle of the mobile terminal, for example, control the rendering direction of the video content in the full-screen playback view to rotate the video content, and in the full-screen playback view Play the rotated video content.
  • Step 24 Rotate the video control bar according to the rotation angle of the mobile terminal.
  • step 21 to step 24 is the same as that of step 11 to step 14, and can be referred to each other, and details are not described herein again.
  • Step 25 After ending the playing of the video content, deleting the full-screen playback view.
  • the full-screen playback view is deleted in order to avoid the prior art.
  • the playback mode is switched to the full-screen mode, if the video content ends playing, the browser needs to perform the WebView on the webpage containing the current video again. The problem of re-typesetting.
  • the full-screen playback view is deleted, and no re-typesetting is needed, which reduces the consumption of hardware resources such as CPU, and accelerates the switching process, saving
  • the screen switching time is convenient for the user to perform other operations on the mobile terminal.
  • the garbled code is no longer displayed on the screen of the mobile terminal, which improves the user experience.
  • Step 31 Create a full screen blank view and create a full screen play view, the full screen play view is a texture view TextureView, and the TextureView is overlaid on the full screen blank view.
  • Step 32 By calling the player interface, establishing a connection relationship between the TextureView and the player, and loading the video content to be played in the player to the TextureView.
  • Step 33 Acquire a rotation angle of the mobile terminal set in the Matrix class, change the video content according to the rotation angle of the mobile terminal, rotate the video content in a rendering direction of the TextureView, and play the rotated video in the TextureView. content.
  • the rotation angle of the mobile terminal set in the Matrix class is usually 90 ⁇ 360 degrees or 270 ⁇ 360 degrees. Of course, other angles set by the user may also be used, which is not limited in this application.
  • the Matrix class is used to provide a rotation angle of a mobile terminal required when the video content is rotated, and the Matrix class may be created after the video content is loaded into the TextureView, or may be pre-created before the step 32, and the application does not do this. limited.
  • the method for switching the play mode of the mobile terminal disclosed in the embodiment of the present application further includes:
  • Step 34 Rotate the video control strip by using a setRotate function, and the angle of the rotation of the video control strip is the same as the rotation angle of the mobile terminal.
  • the above description and the working flow chart provided in FIG. 7 are to rotate the video control bar after the rotation of the video content is completed.
  • the video control strip may also be rotated before or at the same time as the video content is rotated, which is not limited in this application.
  • Step 41 Create a full screen blank view, and create a full screen play view, the full screen play view is a GlSurfaceView (opengl surface view), and the GlSurfaceView is overlaid on the full screen blank view.
  • GlSurfaceView opengl surface view
  • Step 42 Store the video content to be played included in the player into the buffer, and copy the video content to be played in the buffer, and load the copied video content onto the GlSurfaceView.
  • Step 43 Acquire a rotation angle of the mobile terminal set in the matrix Matrix class, rotate the video content according to the rotation angle of the mobile terminal, and play the rotated video content in the GlSurfaceView.
  • the rotation angle of the mobile terminal set in the Matrix class is usually 90 ⁇ 360 degrees or 270 ⁇ 360 degrees. Of course, other angles set by the user may also be used, which is not limited in this application.
  • the Matrix class is used to provide a rotation angle of a mobile terminal required when the video content is rotated, and the Matrix class may be created after the video content is loaded into the TextureView, or may be pre-created before the step 32, and the application does not do this. limited.
  • the method for switching the play mode of the mobile terminal disclosed in the embodiment of the present application further includes:
  • Step 44 Rotate the video control strip by using a setRotate function, and the angle of the rotation of the video control strip is the same as the rotation angle of the mobile terminal.
  • the above description and the working flow chart provided in FIG. 8 are to rotate the video control bar after the rotation of the video content is completed.
  • the video control strip may also be rotated before or at the same time as the video content is rotated, which is not limited in this application.
  • the above two embodiments respectively describe a method for switching the playing mode of the mobile terminal when the full-screen playback view is TextureView and GlSurfaceView. Since the above two embodiments switch the play mode, the browser does not need to re-type the current page, which reduces the consumption of hardware such as the CPU caused by the re-typesetting, thereby accelerating the switching process, so that the screen is played when the video is played in the browser. The switching rate is faster. Further, the screen is prevented from being garbled during the switching process, which improves the user experience.
  • the present application also discloses a mobile terminal playing mode switching device.
  • the mobile terminal playing mode switching device includes: a creating module 100, a loading module 200, and a first rotating module 300.
  • the creating module 100 is configured to create a full-screen blank view, and create a full-screen playback view, so that the full-screen playback view covers the full-screen blank view;
  • the loading module 200 is configured to load video content to be played to the full-screen playback view
  • the first rotation module 300 is configured to rotate the video content loaded to the full-screen playback view according to the received rotation angle of the mobile terminal, and play the rotated video content in the full-screen playback view.
  • the mobile terminal playback mode switching apparatus further includes: a second rotation module 400, wherein the second rotation module 400 is configured to rotate the video control bar according to the rotation angle of the mobile terminal.
  • the loading module 200 can take a variety of forms.
  • the loading module 200 includes: a connecting unit and a first loading unit.
  • connection unit is configured to establish, by using a player interface, a connection relationship between the player and the full-screen playback view.
  • the first loading unit is configured to acquire video content to be played included in the player by using the connection relationship, and load the video content to be played to the full-screen playback view.
  • the loading module 200 includes: a storage unit and a second loading unit.
  • the storage unit is configured to store the video content to be played included in the player into the buffer
  • the second loading unit is configured to copy the video content to be played in the buffer, and load the copied video content into the full-screen playback view.
  • the mobile terminal playback mode switching device further includes: a deletion module, wherein the deletion module is configured to delete the full-screen playback view after ending the playing of the video content.
  • the rotation angle of the mobile terminal is 90+360 degrees or 270+360 degrees.
  • the present application also discloses a computer readable medium having program code executable by a processor, applied to an electronic device, when executed, the program code causes the processor to perform the following steps:
  • the video content loaded to the full-screen playback view is rotated according to the received rotation angle of the mobile terminal, and the rotated video content is played in the full-screen playback view.
  • step that the program code causes the processor to perform further includes:
  • the video control strip is rotated according to the rotation angle of the mobile terminal.
  • the step of loading the video content to be played to the full-screen playback view includes:
  • the step of loading the video content to be played to the full-screen playback view includes:
  • the step of the program code causing the processor to perform further comprises: deleting the full-screen playback view after ending the playing of the video content.
  • the mobile terminal has a rotation angle of 90+360 degrees or 270+360 degrees.
  • FIG. 11 is a flow chart showing a method of improving graphics rendering efficiency, according to an exemplary embodiment.
  • the method can be used in a terminal device such as a mobile phone, a tablet computer, a PC (personal computer), and the like. Referring to Figure 11, the method can include the following steps:
  • Drawing programs such as HTML5-based game engines, are typically drawn based on nodes on the graph.
  • the graphic can correspond to a rendering tree.
  • the rendering tree has a root and a plurality of branches, and the roots and branches can be collectively referred to as a graphics node, referred to as a node.
  • the graphics node has display attributes.
  • the display attributes of the node may include one or more of the following elements: the x coordinate of the node, the y coordinate of the node, the width of the node, The height of the node, the angle of rotation of the node, the angle of inclination of the node, the transparency of the node, the visibility of the node, and the color of the node.
  • the display properties of a graph node can be changed by other applications to make the graph change.
  • the drawing program can obtain the display properties of each node at the current frame by traversing each graph node and performing an operation of updating the display attributes in the traversal.
  • the graphics are not directly redrawn according to the display attributes, but the change of the display attributes of each node compared with the previous frame is detected first. The situation, then decide whether to redraw.
  • the display attributes of the nodes are changed, and may include:
  • the graphics are redrawed according to display attributes of each node only when it is detected that the display attributes of the nodes are changed, and for each subsequent predetermined number of frames, each node is acquired. After the attribute is displayed, the graphic is directly redrawn according to the obtained display attributes of each node.
  • step S103 after detecting that the display attributes of the nodes have changed, in addition to redrawing the current frame, a direct redraw operation is performed for each frame of the first predetermined number of frames that are subsequently sequentially arrived. It is no longer detected whether the display attributes of each node change, thereby reducing the number of times the detection attribute of each node is changed, which improves the efficiency of graphic drawing, thereby reducing unnecessary CPU resources and the like.
  • step 101 Returning to the step of obtaining display attributes of each node on the current frame graph. That is, return to step 101.
  • steps S101 to S103 can be cycled for continuous drawing.
  • the method may further include:
  • step S104 When it is detected that the display attributes of the nodes are not changed, the step of redrawing the graphics according to the display attributes of the nodes is not performed, but returning to the acquiring the current frame graphics. The step of displaying the attributes of the node, that is, jumping back to step S101.
  • the method may further include:
  • each time the display attribute of each node is acquired within a subsequent specified time period, according to the acquired nodes The display attribute directly redraws the graphic;
  • FIG. 14 is a flow chart showing a method of improving graphics rendering efficiency, according to an exemplary embodiment.
  • Javascript can draw graphics in the browser according to the drawing interface provided by Canvas.
  • the frame rate is 35 frames per second, and the interval between each frame is 1/35 second, that is, every 1/35. Seconds allows redrawing the graph once.
  • S401 Traverse all the graph nodes, and obtain display attributes of each graph node during the traversal process.
  • the display properties of the graph node can be modified by other applications.
  • the application can call the setX method through Javascript to modify the x-axis coordinate value of the graph node.
  • the display attribute of each node in the current frame can be obtained.
  • step S402. Determine whether the display attribute of the graphic node changes. If the display attribute of the node has changed, the process proceeds to step S404, otherwise to step S403.
  • step S403. Wait for 1/35 second, and then jump back to step S401. That is, waiting for the next frame, and then judging whether the next frame needs to be redrawn.
  • N Determine whether redrawing of the N frame has been completed by executing S407. That is, whether N redraws have been completed after step S404.
  • the value of N can be set depending on the situation.
  • step S409 If yes, go to step S409; if no, go back to step S405.
  • step S409 wait for 1/35 second, and then jump back to step S401. That is to start a new cycle.
  • the redraw operation before the redrawing, not only whether the display attribute of the graphic node changes is detected, but only when the change is found, the redraw operation is performed, and more importantly, in order to reduce the above The number of checks will be directly redrawed by default for a series of subsequent frames.
  • the graphic drawing mode in the embodiment can not only reduce the number of redrawings, but also reduce the number of times the detection node display attribute changes, thereby effectively improving the graphics rendering efficiency and reducing the consumption of unnecessary CPU resources and the like.
  • the techniques in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, the technical solution in the embodiments of the present invention is essentially It is said that the part contributing to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as a ROM/RAM, a magnetic disk, an optical disk, etc., including a plurality of instructions for making one
  • the computer device (which may be a personal computer, server, or network device;) performs the methods described in various embodiments of the present invention or in some portions of the embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Computer Hardware Design (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

本申请公开了一种移动终端播放方式切换方法、装置、存储介质和程序。该方法中,首先创建全屏空白视图,并创建一个全屏播放视图,使所述全屏播放视图覆盖所述全屏空白视图;然后将待播放的视频内容加载至所述全屏播放视图;在接收到移动终端旋转角度后,旋转加载至所述全屏播放视图的视频内容,并在所述全屏播放视图中播放旋转后的视频内容。所述移动终端播放方式切换方法通过旋转视频内容,实现移动终端播放方式的切换,将竖屏形式下的非全屏模式切换至横屏形式下的全屏模式,而切换过程中,不再需要对网络视图显示的视频内容重新排版,减少了CPU等硬件资源的消耗,从而加速了切换进程,使视频能够流畅播放。

Description

移动终端播放方式切换方法、装置、存储介质和程序 技术领域
本发明涉及信息处理技术领域,特别涉及一种移动终端播放方式切换方法及装置。
背景技术
目前,移动终端的性能日益提高,用户可以通过移动终端访问浏览器,并利用浏览器直接播放网络视频。
在利用移动终端播放网络视频时,默认的播放方式通常为非全屏模式。在非全屏模式下,网络视频通常以竖屏形式播放。为了提高视觉体验,用户更倾向于在全屏模式下观看网络视频,在全屏模式下,网络视频通常以横屏形式播放。为了以横屏形式观看全屏模式下的网络视频,移动终端需要进行从非全屏模式到全屏模式的切换,以及从竖屏形式向横屏形式的切换,以将竖屏形式下的非全屏模式切换至横屏形式下的全屏模式。现有技术在切换移动终端的播放方式时,是将视频所在的View(视图)从WebView(网页视图)中分离出来,放到一个全屏的View上,利用事件(Activity)中的方向属性(Oritation)来将整个WebView旋转为横屏显示。这样视频的内容就能横屏全屏播放了,最大的利用了屏幕空间。这种实现方式下WebView发生旋转,会导致浏览器内核重新排版。当全屏播放结束后退回到非全屏下的网页显示,WebView又要发生一次从横屏切换为竖屏的旋转,会导致浏览器内核又会再进行一次排版。而浏览器内核排版涉及到要对每个网页元素需要重新计算坐标和大小,所以如果在横竖屏切换导致浏览器内核对网页的重新排版会占用很多CPU等硬件资源,进一步导致切换速度变慢,而且重新排版的过程中,用户会看到一个混乱的网页,用户体验差。
发明内容
本申请的实施例公开了一种移动终端播放方式切换方法。该方法中,首先创建全屏空白视图,并创建一个全屏播放视图,使所述全屏播放视图覆盖所述全屏空白视图;然后待播放的视频内容加载至所述全屏播放视图;根据接收到的移动终端旋转角度,旋转加载至所述全屏播放视图的视频内容,并在所述全屏播放视图中播放旋转后的视频内容。
本发明的实施例另一方面还公开了一种移动终端播放方式切换装置,包括一个或多个处理器,以及一个或多个存储有计算机可执行指令的存储器,当所述可执行指令被执行时,使得一个或多个处理器执行如下步骤:创建全屏空白视图,并创建一个全屏播放视图,使 所述全屏播放视图覆盖所述全屏空白视图;将待播放的视频内容加载至所述全屏播放视图;
根据接收到的移动终端旋转角度,旋转加载至所述全屏播放视图的视频内容,并在所述全屏播放视图中播放旋转后的视频内容。
本发明的实施例又一方面提供了一种具有处理器可执行的程序代码的计算机可读介质,应用于移动终端,所述程序代码使处理器执行下述步骤:创建全屏空白视图,并创建一个全屏播放视图,使所述全屏播放视图覆盖所述全屏空白视图;将待播放的视频内容加载至所述全屏播放视图;根据接收到的移动终端旋转角度,旋转加载至所述全屏播放视图的视频内容,并在所述全屏播放视图中播放旋转后的视频内容。
本发明实施例最后还提供了一种移动终端播放方式切换程序,具有如上述方法的步骤。
所述移动终端播放方式切换方法通过旋转视频内容,实现移动终端播放方式的切换,将竖屏形式下的非全屏模式切换至横屏形式下的全屏模式,而切换过程中,由于改变的是视频内容在全屏播放视图中的渲染方向,浏览器不再需要对网页进行重新排版,减少了由于视频屏幕切换时,浏览器内核对当前视频页面重新排版所导致的CPU等硬件资源的消耗,进而加速了切换进程,使视频能够流畅播放。
进一步的,现有技术在对视频屏幕切换导致WebView(网页视图)显示当前视频页面的内容期间屏幕显示乱码,影响用户体验。而本申请无需重新排版,不会出现乱码,进一步提高了用户体验。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本发明公开的移动终端播放方式切换方法的一个实施例流程图;
图2(a)为移动终端在非全屏模式下的屏幕示意图;
图2(b)为应用本发明公开的移动终端播放方式切换方法后,移动终端在全屏模式下的屏幕示意图;
图2(c)为应用本发明公开的移动终端播放方式切换方法后,移动终端在全屏模 式下的屏幕示意图;
图3为本发明公开的移动终端播放方式切换方法的又一个实施例流程图;
图4为本发明公开的移动终端播放方式切换方法中,加载视频内容的一种原理示例图;
图5为本发明公开的移动终端播放方式切换方法中,加载视频内容的又一种原理示例图;
图6为本发明公开的移动终端播放方式切换方法的又一个实施例流程图;
图7为本发明公开的移动终端播放方式切换方法的又一个实施例流程图;
图8为本发明公开的移动终端播放方式切换方法的又一个实施例流程图;
图9为本发明公开的移动终端播放方式切换装置的一个实施例框图;
图10为本发明公开的移动终端播放方式切换装置的又一个实施例框图;
图11是根据一示例性实施例示出的一种提高图形绘制效率的方法的流程图;
图12是根据一示例性实施例示出的一种提高图形绘制效率的方法的流程图;
图13是根据一示例性实施例示出的一种提高图形绘制效率的方法的流程图;
图14是根据一示例性实施例示出的一种提高图形绘制效率的方法的流程图;
具体实施方式
本发明如下的实施例提供一种移动终端播放方式切换方法及装置,以解决在对移动终端播放方式进行切换时,对视频内容重新排版耗费大量时间,从而影响视频流畅播放的问题。
为了使本技术领域的人员更好地理解本发明实施例中的技术方案,并使本发明实施例的上述目的、特征和优点能够更加明显易懂,下面结合附图对本发明实施例中技术方案作进一步详细的说明。
参见图1所示的方法流程示意图,本申请的实施例公开的移动终端播放方式切换方法包括:
步骤11、创建全屏空白视图,并创建一个全屏播放视图,使所述全屏播放视图覆盖 所述全屏空白视图。
当用户需要播放网络视频时,移动终端默认的播放方式为非全屏模式,若用户选择全屏模式播放网络视频时,移动终端需要进行播放方式的切换。本申请所公开的移动终端播放方式切换方法中,在创建全屏空白视图后,需再创建一个全屏播放视图,并将所述全屏播放视图覆盖在所述全屏空白视图上。
步骤12、获取将待播放的视频内容,加载至所述全屏播放视图。
步骤13、根据接收到的移动终端旋转角度,旋转加载至所述全屏播放视图的视频内容,例如改变视频内容在全屏播放视图中的渲染方向来改变视频内容的方向,并在所述全屏播放视图中播放旋转后的视频内容。优选根据接收到的移动终端旋转角度来旋转加载至所述全屏播放视图的视频内容。
所述移动终端旋转角度的具体数值,可根据用户的观看需求进行设定。由于非全屏模式下,视频内容通常为竖屏形式,全屏模式下,视频内容通常为横屏形式,因此,为了实现将竖屏形式的视频内容切换为横屏形式,所述移动终端旋转角度通常为90±360度或270±360度。当然,根据用户的观看需求,所述移动终端旋转角度还可以为其他的数值,本申请对此不做限定。
参见图2(a)至图2(c)的移动终端的屏幕示意图。其中,图2(a)中针对的播放方式为非全屏模式,该种情况下,视频内容以竖屏形式呈现。图2(b)针对的播放方式为全屏模式,该种情况下,已根据移动终端旋转角度完成对所述视频内容的旋转,且所述移动终端旋转角度为90±360度,从而使视频内容在全屏播放视图中以横屏形式呈现。图2(c)针对的播放方式为全屏模式,该种情况下,在一些实施方式中,根据移动终端旋转角度完成对所述视频内容的旋转,且所述移动终端旋转角度为270±360度,从而使视频内容在全屏播放视图中以横屏形式呈现。
本申请的实施例公开了一种移动终端播放方式切换方法。该方法中,首先创建全屏空白视图,并创建一个全屏播放视图,使所述全屏播放视图覆盖所述全屏空白视图;然后将待播放的视频内容加载至所述全屏播放视图;在接收到移动终端旋转角度后,旋转加载至所述全屏播放视图的视频内容,并在所述全屏播放视图中播放旋转后的视频内容。
所述移动终端播放方式切换方法通过旋转视频内容,实现移动终端播放方式的切换,将竖屏形式下的非全屏模式切换至横屏形式下的全屏模式,而切换过程中,浏览器不再需要对网页进行重新排版。减少了由于视频屏幕切换时,需要浏览器内核对当前视频页面进行重新排版所导致的CPU等硬件资源的消耗,从而加速了切换进程,使视频能够流畅 播放。
进一步的,现有技术在对视频屏幕切换导致WebView(网页视图)显示当前视频页面的内容期间屏幕显示乱码,影响用户体验。而本申请无需重新排版,不会出现乱码,进一步提高了用户体验。
参见图3,本申请公开的移动终端播放方式切换方法还包括:
步骤14、根据所述移动终端旋转角度,旋转视频控制条。
在上文的描述和图3所示的工作流程中,是在完成步骤13的操作,即完成对视频内容的旋转后,才旋转视频控制条。在实际应用中,还可以在旋转所述视频内容之前或同时,对视频控制条进行旋转,本申请对此不做限定。
所述视频控制条的旋转角度,与所述视频内容的旋转角度相同,便于用户在全屏模式下观看视频内容时,知悉视频播放进度。
另外,为了避免出现切换失误,在步骤12和步骤13之间,还可以执行判断操作,该操作中判断加载在全屏播放视图中的视频内容是否为竖屏形式,如果是,则根据移动终端旋转角度对视频内容进行旋转,实现竖屏模式到横屏模式的切换,如果否,则说明所述视频内容当前为横屏模式,不再旋转,直接播放即可。
在步骤S12中,公开了将待播放的视频内容加载至全屏播放视图的步骤,该步骤包括多种实现方式。参见图4,其中一种实现方式中,所述将待播放的视频内容加载至所述全屏播放视图的步骤包括:
步骤121、通过播放器接口,建立播放器与所述全屏播放视图的连接关系。
步骤122、通过所述连接关系,获取播放器中包含的待播放的视频内容,并将所述待播放的视频内容加载至所述全屏播放视图。
步骤121至步骤122公开的方案中,通过播放器接口,实现播放器与全屏播放视图的关联,然后获取播放器包含的视频内容,将其加载至所述全屏播放视图。
可选的,参见图5,在另一种实现方式中,所述将待播放的视频内容加载至所述全屏播放视图的步骤包括:
步骤123、将播放器中包含的待播放的视频内容存储至缓存器中。
步骤124、复制所述缓存器中的待播放的视频内容,并将复制后的视频内容加载至所述 全屏播放视图上。
通过步骤123至步骤124公开的方案,能够将待播放的视频内容加载至全屏播放视图中。
进一步的,本申请的实施例还公开了一种移动终端播放方式切换方法,参见图6,该方法包括:
步骤21、创建全屏空白视图,并创建一个全屏播放视图,使所述全屏播放视图覆盖所述全屏空白视图。
步骤22、将待播放的视频内容加载至所述全屏播放视图。
步骤23、根据接收到的移动终端旋转角度,旋转加载至所述全屏播放视图的视频内容,例如可以控制视频内容在全屏播放视图中的渲染方向来旋转视频内容,并在所述全屏播放视图中播放旋转后的视频内容。
步骤24、根据所述移动终端旋转角度,旋转视频控制条。
步骤21至步骤24的实施过程与步骤11至步骤14的实施过程相同,可相互参照,此处不再赘述。
步骤25、在结束所述视频内容的播放后,删除所述全屏播放视图。
在结束视频内容的播放后,删除所述全屏播放视图,是为了避免出现现有技术在将播放方式切换至全屏模式后,若视频内容结束播放,浏览器需要再次对包含当前视频的网页进行WebView重新排版的问题。
本申请实施例公开的移动终端播放方式切换方法中,在结束视频内容的播放后,删除所述全屏播放视图,不需要重新排版,减少了对CPU等硬件资源的消耗,并加速切换进程,节省了屏幕切换时间,便于用户对移动终端进行其他操作。并且,移动终端的屏幕处不再显示乱码,提升了用户体验。
为了便于理解,以下通过两个具体的实施方式对本申请实施例公开的移动终端播放方式切换方法进行介绍。
在第一种实施方式中,参见图7,包括以下步骤:
步骤31、创建全屏空白视图,并创建一个全屏播放视图,所述全屏播放视图为纹理视图TextureView,并且将所述TextureView覆盖所述全屏空白视图。
步骤32、通过调用播放器接口,将所述TextureView与播放器建立连接关系,将播放器中待播放的视频内容加载至TextureView。
步骤33、获取矩阵Matrix类中设置的移动终端旋转角度,根据所述移动终端旋转角度改变所述视频内容在TextureView的渲染方向来旋转所述视频内容,并在所述TextureView中播放旋转后的视频内容。
其中,所述Matrix类中设置的移动终端旋转角度通常为90±360度或270±360度,当然也可以为用户设置的其他角度,本申请对此不做限定。所述Matrix类用于提供视频内容旋转时所需的移动终端旋转角度,并且,所述Matrix类可在视频内容加载至TextureView后创建,也可在步骤32前预先创建,本申请对此不做限定。
另外,本申请实施例公开的移动终端播放方式切换方法还包括:
步骤34、使用setRotate函数对视频控制条进行旋转,所述视频控制条旋转的角度与所述移动终端旋转角度相同。
上述描述和图7提供的工作流程图,是在完成对视频内容的旋转后,才旋转视频控制条。在实际应用中,还可以在旋转所述视频内容之前或同时,对视频控制条进行旋转,本申请对此不做限定。
在第二种实施方式中,参见图8,包括以下步骤:
步骤41、创建全屏空白视图,并创建一个全屏播放视图,所述全屏播放视图为GlSurfaceView(opengl Surface View,开放图形语言表面视图),并且将所述GlSurfaceView覆盖所述全屏空白视图。
步骤42、将播放器中包含的待播放的视频内容存储至缓存器中,并复制缓存器中待播放的视频内容,将复制后的视频内容加载至所述GlSurfaceView上。
步骤43、获取矩阵Matrix类中设置的移动终端旋转角度,根据所述移动终端旋转角度旋转所述视频内容,并在所述GlSurfaceView中播放旋转后的视频内容。
其中,所述Matrix类中设置的移动终端旋转角度通常为90±360度或270±360度,当然也可以为用户设置的其他角度,本申请对此不做限定。所述Matrix类用于提供视频内容旋转时所需的移动终端旋转角度,并且,所述Matrix类可在视频内容加载至TextureView后创建,也可在步骤32前预先创建,本申请对此不做限定。
另外,本申请实施例公开的移动终端播放方式切换方法还包括:
步骤44、使用setRotate函数对视频控制条进行旋转,所述视频控制条旋转的角度与所述移动终端旋转角度相同。
上述描述和图8提供的工作流程图,是在完成对视频内容的旋转后,才旋转视频控制条。在实际应用中,还可以在旋转所述视频内容之前或同时,对视频控制条进行旋转,本申请对此不做限定。
以上两个实施例,分别描述了当全屏播放视图为TextureView和GlSurfaceView时,对移动终端的播放方式进行切换的方法。由于上述两个实施例切换播放方式时,不需要浏览器对当前页面进行重新排版,减少了因为重新排版导致的CPU等硬件的消耗,从而加速了切换进程,使得在浏览器中播放视频时屏幕切换速率更快。进一步的,避免屏幕在切换过程中出现乱码,提高了用户的体验。
相应的,本申请还公开了一种移动终端播放方式切换装置,参见图9,所述移动终端播放方式切换装置包括:创建模块100、加载模块200和第一旋转模块300。
其中,所述创建模块100,用于创建全屏空白视图,并创建一个全屏播放视图,使所述全屏播放视图覆盖所述全屏空白视图;
所述加载模块200,用于将待播放的视频内容加载至所述全屏播放视图;
所述第一旋转模块300,用于根据接收到的移动终端旋转角度,旋转加载至所述全屏播放视图的视频内容,并在所述全屏播放视图中播放旋转后的视频内容。
进一步的,参见图10,所述移动终端播放方式切换装置还包括:第二旋转模块400,所述第二旋转模块400用于根据所述移动终端旋转角度,旋转视频控制条。
所述加载模块200可以为多种形式。其中一种实现形式中,所述加载模块200包括:连接单元和第一加载单元。
其中,所述连接单元,用于通过播放器接口,建立播放器与所述全屏播放视图的连接关系;
所述第一加载单元,用于通过所述连接关系,获取播放器中包含的待播放的视频内容,并将所述待播放的视频内容加载至所述全屏播放视图。
在另一种实现形式中,所述加载模块200包括:存储单元和第二加载单元。
其中,所述存储单元,用于将播放器中包含的待播放的视频内容存储至缓存器中;
所述第二加载单元,用于复制所述缓存器中的待播放的视频内容,并将复制后的视频内容加载至所述全屏播放视图上。
另外,所述移动终端播放方式切换装置还包括:删除模块,所述删除模块用于在结束所述视频内容的播放后,删除所述全屏播放视图。
其中,所述移动终端旋转角度为90+360度或270+360度。
相应的,本申请还公开了一种具有处理器可执行的程序代码的计算机可读介质,应用于电子设备,在被执行时,所述程序代码使处理器执行下述步骤:
创建全屏空白视图,并创建一个全屏播放视图,使所述全屏播放视图覆盖所述全屏空白视图;
将待播放的视频内容加载至所述全屏播放视图;
根据接收到的移动终端旋转角度,旋转加载至所述全屏播放视图的视频内容,并在所述全屏播放视图中播放旋转后的视频内容。
可选的,所述程序代码使处理器执行的步骤还包括:
根据所述移动终端旋转角度,旋转视频控制条。
可选的,所述将待播放的视频内容加载至所述全屏播放视图的步骤包括:
通过播放器接口,建立播放器与所述全屏播放视图的连接关系;
通过所述连接关系,获取播放器中包含的待播放的视频内容,并将所述待播放的视频内容加载至所述全屏播放视图。
可选的,所述将待播放的视频内容加载至所述全屏播放视图的步骤包括:
将播放器中包含的待播放的视频内容存储至缓存器中;
复制所述缓存器中的待播放的视频内容,并将复制后的视频内容加载至所述全屏播放视图上。
可选的,所述程序代码使处理器执行的步骤还包括:在结束所述视频内容的播放后,删除所述全屏播放视图。
可选的,所述移动终端旋转角度为90+360度或270+360度。
图11是根据一示例性实施例示出的一种提高图形绘制效率的方法的流程图。该方法可用于终端设备中,如手机、平板电脑、PC(个人电脑)等。参见图11所示,该方法可以包括以下步骤:
S101、获取当前帧图形上各节点的显示属性。
绘图程序,例如基于HTML5的游戏引擎,通常是基于图形上的节点来进行绘图的。图形可对应一棵渲染树,这棵渲染树有一个根以及众多枝叶,根及枝叶都可统称为图形节点,简称节点。
图形节点具有显示属性,在本实施例或本发明其他某些实施例中,节点的显示属性可以包括以下元素中的一种或多种:节点的x坐标、节点的y坐标、节点的宽度、节点的高度、节点的旋转角度、节点的倾斜角度、节点的透明度、节点的可见性以及节点的颜色。
图形节点的显示属性可以被其他应用程序所更改,从而使图形发生变化。绘图程序通过遍历各图形节点并在遍历中执行更新显示属性的操作,可以获取到每个节点在当前帧时的显示属性。
S102、检测各节点的显示属性与前一帧时各节点的显示属性相比的变化情况。
在本实施例中,获取到当前帧时图形上各节点的显示属性后,并不直接根据显示属性对图形进行重绘,而是先检测各节点的显示属性与前一帧时相比的变化情况,然后再决定是否重绘。
在本实施例或本发明其他某些实施例中,所述各节点的显示属性发生了变化,可以包括:
任一节点的任一元素发生了变化。
也即只要检测到任一节点的任一元素发生了变化,即可得到各节点的显示属性发生了变化这一结论。相反的,若检测到任一节点的任一元素都未发生变化,则可得到各节点的显示属性均未发生变化这一结论。
S103、只有在检测到各节点的显示属性发生了变化时,才根据各节点的显示属性对所述图形进行重绘,以及,对于随后的第一预定数目的帧,每次获取到各节点的显示属性后根据获取的各节点的显示属性直接对所述图形进行重绘。
对于每一帧,在增加了检测各节点显示属性是否变化的操作后,虽然能够减少重 绘的次数,但也带了弊端:每次(也即每一帧)都需要进行检测,这样使得检测的次数过多,不利于提高绘图效率。在步骤S103中,在检测到各节点的显示属性发生了变化后,除了对当前帧进行重绘外,对于随后依次到来的第一预定数目的帧的每一帧,均采取直接重绘的操作,不再检测各节点显示属性是否变化,从而减少了检测各节点显示属性是否变化的次数,真正提高了图形绘制的效率,进而降低了不必要的CPU资源等消耗。
参见图12所示,在本实施例或本发明其他某些实施例中,在所述对于随后的第一预定数目的帧,每次获取到各节点的显示属性后根据获取的各节点的显示属性直接对所述图形进行重绘的步骤之后:
返回所述获取当前帧图形上各节点的显示属性的步骤。也即返回步骤101。
这样步骤S101至S103便可循环起来,进行持续的绘图。
另外,参见图13所示,在本实施例或本发明其他某些实施例中,在所述检测各节点的显示属性与前一帧时各节点的显示属性相比的变化情况的步骤之后,所述方法还可以包括:
S104、在检测到各节点的显示属性均未发生变化时,则不执行所述根据所述各节点的显示属性对所述图形进行重绘的步骤,而是返回所述获取当前帧图形上各节点的显示属性的步骤,也即跳回步骤S101。
这样在检测到各节点的显示属性均未发生变化时不进行重绘,可以减少重绘的次数,也提高了图形绘制的效率,进而降低了不必要的CPU资源等消耗。
此外,所述方法还可以包括:
若对于连续的第二预定数目的帧,每次检测到的各节点的显示属性均未发生变化,则在随后的指定时长内,每次获取到各节点的显示属性后根据获取的各节点的显示属性直接对所述图形进行重绘;
然后,返回所述获取当前帧图形上各节点的显示属性的步骤。
这样,可以进一步减少检测各节点显示属性是否变化的次数,从而进一步提高图形绘制的效率。
下面结合具体场景对本发明进行进一步描述。
图14是根据一示例性实施例示出的一种提高图形绘制效率的方法的流程图。在 本实施例场景下,Javascript可以根据Canvas提供的绘图接口在浏览器中进行图形绘制,帧率为每秒35帧,每帧图形之间的间隔为1/35秒,也即每隔1/35秒就允许对图形重绘一次。
S401、遍历所有图形节点,并在遍历过程中获取每个图形节点的显示属性。图形节点的显示属性能够被其他应用程序修改,例如应用程序可以通过Javascript来调用setX方法来修改图形节点的x轴坐标数值。通过执行更新的操作,可以获取到每个节点在当前这一帧的显示属性。
S402、判断是否有图形节点的显示属性发生了变化。如果有节点的显示属性发生了变化,则进入步骤S404,否则进入步骤S403。
S403、等待1/35秒,然后跳回步骤S401。即等待下一帧,然后判断下一帧是否需要重绘。
S404、调用Canvas的绘图接口,根据各图形节点的显示属性对图形进行重绘。
S405、等待1/35秒。
S406、遍历所有图形节点,并在遍历过程中获取每个图形节点的显示属性。
S407、调用Canvas的绘图接口,根据各图形节点的显示属性对图形进行重绘。此时不再进行节点显示属性是否变化的判断。
S408、判断通过执行S407是否已完成对N帧的重绘。也即在步骤S404之后是否已完成了N次重绘。N值可以根据情况而设置。
如果是,则进入步骤S409;如果否,则跳回步骤S405。
S409、等待1/35秒,然后跳回步骤S401。即开启新一轮循环。
在本实施例中,在进行重绘前,不但先对是否有图形节点的显示属性发生了变化进行检测,只有当发现有变化时才进行重绘操作,而且更为重要的是,为了减少上述检测的次数,会对随后的一系列帧都默认进行直接的重绘。本实施例中的这种图形绘制方式不但能够减少重绘的次数,更能够减少检测节点显示属性是否发生变化的次数,从而真正提高图形绘制效率,降低不必要的CPU资源等的消耗。
本领域的技术人员可以清楚地了解到本发明实施例中的技术可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本发明实施例中的技术方案本质上或 者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备;)执行本发明各个实施例或者实施例的某些部分所述的方法。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
以上所述的本发明实施方式,并不构成对本发明保护范围的限定。任何在本发明的精神和原则之内所作的修改、等同替换和改进等,均应包含在本发明的保护范围之内。

Claims (16)

  1. 一种移动终端播放方式切换方法,其特征在于,所述方法包括:
    创建全屏空白视图,并创建一个全屏播放视图,使所述全屏播放视图覆盖所述全屏空白视图;
    将待播放的视频内容加载至所述全屏播放视图;
    根据接收到的移动终端旋转角度,旋转加载至所述全屏播放视图的视频内容,并在所述全屏播放视图中播放旋转后的视频内容。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    根据所述移动终端旋转角度,旋转视频控制条。
  3. 根据权利要求1所述的方法,其特征在于,所述将待播放的视频内容加载至所述全屏播放视图的步骤包括:
    通过播放器接口,建立播放器与所述全屏播放视图的连接关系;
    通过所述连接关系,获取播放器中包含的待播放的视频内容,并将所述待播放的视频内容加载至所述全屏播放视图。
  4. 根据权利要求1所述的方法,其特征在于,所述将待播放的视频内容加载至所述全屏播放视图的步骤包括:
    将播放器中包含的待播放的视频内容存储至缓存器中;
    复制所述缓存器中的待播放的视频内容,并将复制后的视频内容加载至所述全屏播放视图上。
  5. 根据权利要求1至4任一项所述的方法,其特征在于,所述方法还包括:
    在结束所述视频内容的播放后,删除所述全屏播放视图。
  6. 根据权利要求1至2任一项所述的方法,其特征在于,
    所述移动终端旋转角度为90+360度或270+360度。
  7. 根据权利要求1所述的方法,其特征在于,所述旋转加载至所述全屏播放视图的视频内容的步骤包括:
    旋转所述视频内容在所述全屏播放视图中的渲染方向。
  8. 如权利要求7所述的方法,其特征在于,如果需要横屏播放,该方法还包括:
    判断所述待播放的视频内容为横屏或竖屏;
    如果是竖屏,所述全屏播放视图获取旋转角度后,旋转所述视频内容在所述全屏播放视图中的渲染方向,使得所述视频内容在所述全屏播放视图中横屏播放。
  9. 一种移动终端播放方式切换装置,包括一个或多个处理器,以及一个或多个存储有计算机可执行指令的存储器,当所述可执行指令被执行时,使得一个或多个处理器执行如下步骤:
    创建全屏空白视图,并创建一个全屏播放视图,使所述全屏播放视图覆盖所述全屏空白视图;
    将待播放的视频内容加载至所述全屏播放视图;
    根据接收到的移动终端旋转角度,旋转加载至所述全屏播放视图的视频内容,并在所述全屏播放视图中播放旋转后的视频内容。
  10. 如权利要求9所述的装置,其特征在于,还包括:
    根据所述移动终端旋转角度,旋转视频控制条。
  11. 如权利要求9所述的装置,其特征在于,所述将待播放的视频内容加载至所述全屏播放视图的步骤包括:
    通过播放器接口,建立播放器与所述全屏播放视图的连接关系;
    通过所述连接关系,获取播放器中包含的待播放的视频内容,并将所述待播放的视频内容加载至所述全屏播放视图。
  12. 如权利要求9所述的装置,其特征在于,所述将待播放的视频内容加载至所述全屏播放视图的步骤包括:
    将播放器中包含的待播放的视频内容存储至缓存器中;
    复制所述缓存器中的待播放的视频内容,并将复制后的视频内容加载至所述全屏播放视图上。
  13. 如权利要求9-12任一项所述的装置,其特征在于,还包括在结束所述视频内容的播放后,删除所述全屏播放视图。
  14. 如权利要求9-10任一项所述的装置,其特征在于,所述移动终端旋转角度为90+360度或270+360度。
  15. 一种具有处理器可执行的程序代码的计算机可读介质,应用于移动终端,其特征在于,所述程序代码使处理器执行下述步骤:
    创建全屏空白视图,并创建一个全屏播放视图,使所述全屏播放视图覆盖所述全屏空白视图;
    将待播放的视频内容加载至所述全屏播放视图;
    根据接收到的移动终端旋转角度,旋转加载至所述全屏播放视图的视频内容,并在所述全屏播放视图中播放旋转后的视频内容。
  16. 一种移动终端播放方式切换程序,其特征在于,具有如权利要求1-8所述方法的步骤。
PCT/CN2014/093640 2014-05-30 2014-12-11 移动终端播放方式切换方法、装置、存储介质和程序 WO2015180448A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/315,269 US10643580B2 (en) 2014-05-30 2014-12-11 Method and device for switching playing mode of a mobile terminal, storage medium and program

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201410238962.0A CN105138311B (zh) 2014-05-30 2014-05-30 一种提高图形绘制效率的方法及装置
CN201410238712.7 2014-05-30
CN201410238712.7A CN105306997B (zh) 2014-05-30 2014-05-30 移动终端播放方式切换方法及装置
CN201410238962.0 2014-05-30

Publications (1)

Publication Number Publication Date
WO2015180448A1 true WO2015180448A1 (zh) 2015-12-03

Family

ID=54698021

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/093640 WO2015180448A1 (zh) 2014-05-30 2014-12-11 移动终端播放方式切换方法、装置、存储介质和程序

Country Status (2)

Country Link
US (1) US10643580B2 (zh)
WO (1) WO2015180448A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106547456A (zh) * 2016-10-27 2017-03-29 北京小米移动软件有限公司 终端设备屏幕旋转方法及装置
WO2018094261A1 (en) * 2016-11-21 2018-05-24 Alibaba Group Holding Limited Method and system for managing buffers
US10531149B2 (en) 2016-11-21 2020-01-07 Alibaba Group Holding Limited Method and system for managing buffers

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109144750B (zh) * 2018-08-21 2021-06-15 武汉斗鱼网络科技有限公司 一种消息处理方法、装置、电子设备及存储介质
CN111338537B (zh) * 2020-02-11 2021-06-25 北京字节跳动网络技术有限公司 用于显示视频的方法、装置、电子设备和介质
CN114222188A (zh) * 2021-12-28 2022-03-22 深圳小湃科技有限公司 基于旋转屏的全屏显示方法、装置、设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102905181A (zh) * 2012-10-12 2013-01-30 北京奇艺世纪科技有限公司 一种实现移动终端在线播放视频的方法、底层库和系统
US20130219276A1 (en) * 2011-02-24 2013-08-22 Tencent Technology (Shenzhen Company) Limited Method and Device for Playing Video
CN103281457A (zh) * 2013-06-03 2013-09-04 贝壳网际(北京)安全技术有限公司 一种移动终端浏览器中视频播放方法、装置及浏览器
CN103458106A (zh) * 2013-08-07 2013-12-18 广东欧珀移动通信有限公司 一种控制移动终端横竖屏显示模式的方法及移动终端

Family Cites Families (36)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04181423A (ja) * 1990-11-16 1992-06-29 Fujitsu Ltd バージョン管理方式
US5430870A (en) * 1992-10-13 1995-07-04 Sun Microsystems, Inc. Saving and restoring traversal state attributes of a directed acyclic graph structure network for a parent structure when it invokes a child structure for traversal
US5566287A (en) * 1994-06-28 1996-10-15 Thomson Consumer Electronics, Inc. Method for asynchronously maintaining an image on a display device
US6487565B1 (en) * 1998-12-29 2002-11-26 Microsoft Corporation Updating animated images represented by scene graphs
US7305402B2 (en) * 2001-10-10 2007-12-04 International Business Machines Corporation Adaptive indexing technique for use with electronic objects
US20030110234A1 (en) * 2001-11-08 2003-06-12 Lightsurf Technologies, Inc. System and methodology for delivering media to multiple disparate client devices based on their capabilities
NO318991B1 (no) * 2002-09-05 2005-05-30 Opera Software Asa Presentasjon av HTML-innhold på en liten terminalskjerm
US20040268400A1 (en) * 2003-06-26 2004-12-30 Microsoft Corporation Quick starting video content
US20050071752A1 (en) * 2003-09-24 2005-03-31 Marlatt Jane E. Forms management system
US8813133B1 (en) * 2004-03-17 2014-08-19 Starz Entertainment, Llc Video rotation interface
US7403209B2 (en) * 2004-03-24 2008-07-22 Canon Kabushiki Kaisha Rendering images containing video
JP2005284999A (ja) * 2004-03-30 2005-10-13 Sharp Corp 電子機器
WO2006073020A1 (ja) * 2005-01-05 2006-07-13 Matsushita Electric Industrial Co., Ltd. スクリーン表示装置
US20060274070A1 (en) * 2005-04-19 2006-12-07 Herman Daniel L Techniques and workflows for computer graphics animation system
KR100784542B1 (ko) * 2005-10-20 2007-12-11 엘지전자 주식회사 면접촉 축회전 이동통신단말기
US7535475B2 (en) * 2005-11-01 2009-05-19 Adobe Systems Incorporated Virtual view tree
KR100724956B1 (ko) * 2005-12-13 2007-06-04 삼성전자주식회사 이동 통신 단말의 배경화면 표시 방법
US20080154889A1 (en) * 2006-12-22 2008-06-26 Pfeiffer Silvia Video searching engine and methods
US8914063B2 (en) * 2007-05-15 2014-12-16 Lg Electronics Inc. Mobile terminal equipped with mode setting key and method of controlling the mobile terminal
JP4497194B2 (ja) * 2007-11-12 2010-07-07 株式会社カシオ日立モバイルコミュニケーションズ 携帯端末装置及びプログラム
US20090327100A1 (en) * 2008-06-29 2009-12-31 TV1.com Holdings, LLC Method of Internet Video Access and Management
US8259349B2 (en) * 2008-10-06 2012-09-04 Eastman Kodak Company Document conversion for overprints
KR20100067381A (ko) * 2008-12-11 2010-06-21 삼성전자주식회사 사용자 인터페이스 제공 방법 및 이를 위한 휴대 단말기
KR101580148B1 (ko) * 2009-02-20 2015-12-24 삼성전자주식회사 동작 인식을 통한 단말기 제어 장치 및 방법
US8229287B1 (en) * 2009-08-31 2012-07-24 Adobe Systems Incorporated Multi-modal method for dynamically abridging and expanding media content
KR20110101585A (ko) * 2010-03-09 2011-09-16 삼성전자주식회사 휴대용 단말기의 화면 전환 장치 및 방법
CN102301736A (zh) * 2011-07-06 2011-12-28 华为技术有限公司 视频播放内容切换的方法、装置及移动终端
US8736664B1 (en) * 2012-01-15 2014-05-27 James W. Gruenig Moving frame display
WO2013111247A1 (ja) * 2012-01-24 2013-08-01 株式会社ソニー・コンピュータエンタテインメント 情報処理装置および情報処理システム
KR101905638B1 (ko) * 2012-05-15 2018-12-05 삼성전자주식회사 동영상 재생 장치 및 방법
KR20140050830A (ko) * 2012-10-22 2014-04-30 삼성전자주식회사 단말의 화면 표시 제어 방법 및 그 단말
US9262058B2 (en) * 2013-02-26 2016-02-16 Blackberry Limited System and methods for navigating social networks
US9501460B1 (en) * 2013-02-28 2016-11-22 Google Inc. Detecting and processing invisible elements within a web page
US20140325323A1 (en) * 2013-04-28 2014-10-30 Tencent Technology (Shenzhen) Company Limited Online video playing method and apparatus and computer readable medium
US9317175B1 (en) * 2013-09-24 2016-04-19 Amazon Technologies, Inc. Integration of an independent three-dimensional rendering engine
US9514784B2 (en) * 2014-05-09 2016-12-06 Lg Electronics Inc. Terminal and operating method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130219276A1 (en) * 2011-02-24 2013-08-22 Tencent Technology (Shenzhen Company) Limited Method and Device for Playing Video
CN102905181A (zh) * 2012-10-12 2013-01-30 北京奇艺世纪科技有限公司 一种实现移动终端在线播放视频的方法、底层库和系统
CN103281457A (zh) * 2013-06-03 2013-09-04 贝壳网际(北京)安全技术有限公司 一种移动终端浏览器中视频播放方法、装置及浏览器
CN103458106A (zh) * 2013-08-07 2013-12-18 广东欧珀移动通信有限公司 一种控制移动终端横竖屏显示模式的方法及移动终端

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106547456A (zh) * 2016-10-27 2017-03-29 北京小米移动软件有限公司 终端设备屏幕旋转方法及装置
WO2018094261A1 (en) * 2016-11-21 2018-05-24 Alibaba Group Holding Limited Method and system for managing buffers
US10531149B2 (en) 2016-11-21 2020-01-07 Alibaba Group Holding Limited Method and system for managing buffers

Also Published As

Publication number Publication date
US20170249925A1 (en) 2017-08-31
US10643580B2 (en) 2020-05-05

Similar Documents

Publication Publication Date Title
WO2015180448A1 (zh) 移动终端播放方式切换方法、装置、存储介质和程序
US11344806B2 (en) Method for rendering game, and method, apparatus and device for generating game resource file
US10347023B2 (en) Data drawing method and apparatus, terminal, and storage medium
US20220139352A1 (en) Method and Device for Image Composition, Electronic Device and Storage Medium
JP5963940B2 (ja) 描画の方法、装置、および端末
TWI671647B (zh) 計算頁面首屏描繪時長的方法、裝置及電子設備
JP2011128204A (ja) 広告配信装置、方法及びプログラム
US20140096087A1 (en) Method and device for software interface display on terminal, and computer storage medium
WO2018000372A1 (zh) 画面显示的方法和终端
CN112835499B (zh) 一种轮播图展示方法、装置、设备及介质
WO2018126899A1 (zh) 一种视频界面显示方法及装置
JP2015531918A (ja) ヒットテスト方法および装置
US7598941B2 (en) Pointer for a large display
US8884971B2 (en) Animation engine decoupled from animation catalog
JP5563703B2 (ja) コンテンツ配信装置、コンテンツ配信方法、コンテンツ配信プログラム及び端末用プログラム
CN113849096B (zh) 一种桌面显示方法、装置及计算设备
CN108184159B (zh) 一种进度条的实现方法及装置
CN109800039B (zh) 一种用户界面展示方法、装置、电子设备及存储介质
Kelly et al. Basic introduction to pygame
CN111477183B (zh) 阅读器刷新方法、计算设备及计算机存储介质
CN111460342B (zh) 页面的渲染展示方法、装置、电子设备及计算机存储介质
CN112100420A (zh) 一种基于画布的图片轮播方法
CN114913277A (zh) 一种物体立体交互展示方法、装置、设备及介质
CN113393294A (zh) 一种页面显示方法及装置、设备、存储介质
CN106445274A (zh) 多窗口页面显示处理方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14893250

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 15315269

Country of ref document: US

122 Ep: pct application non-entry in european phase

Ref document number: 14893250

Country of ref document: EP

Kind code of ref document: A1