简体   繁体   中英

How do I extract a video link from an xml file on the iphone?

I want to parse an XML file and if there is a link to a video I want to show it?

How can do this?

Till now I know the xml test example, not more.

Help me out, Thanks in advance.

Once you extract the URL, you'll want to use the MPMoviePlayerViewController class to play it. There's plenty of doc on Apple's website for this: MPMoviePlayerViewController .

1* To get a video url (or and any element value) in a xml file,
use xpath query in order to do that you can use libxml2
read this : Using libxml2 for XML parsing and XPath queries in Cocoa (folow the instructions)

2* Once you get the link read Ben Gottlieb's answer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM