Nvisionxr_ios Tutorial 10--Loading video controls

Source: Internet
Author: User

because in the next section we need to introduce the multi-scene switching function, so in this chapter we create a new scenario, such as
 

rewriteNvsceneplayThe life cycle
 

1. reference header file #import ' NVVideoWidget.h ' 
 


2, in the onCreate method Instance session video control 
 
Code:

Video = [[Nvvideowidget alloc] initwithsceneplay:self widgetname:@ "Video_widget"]; Add a video path, either a local path or a URL (on demand, live) [Video Setvideopath:[nsurl urlwithstring:@] http://221.228.226.23/11/t/j/v/b/     Tjvbwspwhqdmgouolposcsfafpedmb/sh.yinyuetai.com/691201536ee4912bf7e4f1e2c67b8119.mp4 "];     Set coordinates [Video setposition:nvposition (0.0, 0.5, 0.0)];     Set the scale [Video setscale:nvposition (8.0, 1.0, 6.0)];     [Self addwidget:video]; Video preparation [videos prepare];


in theOnresumemethod to play the video
 

in theOnPausepause Video in method
 


in theOnStopmethod to stop the video 
 


in theondestorymethod to destroy the video 
 

3. Add Videoscene class in nvisioncontroller.m  
Reference header File#import ' VideoScene.h ' 
Set the startup scene toVideosceneand WillMyfirstscenecomments, such as:
 
Code:

Videoscene *videoscene = [[Videoscene alloc] initwithname:@ "Video_scene"]; [[Nvappdirector Sharednvappdirector] addsceneplay:@ "Main_sceneplay" scene:videoscene];


To run the project:

Nvisionxr_ios Tutorial 10--Loading video controls

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.