Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 14    Views: 118

GraciousWolf_PE
Aspiring developer
Profile
Posts: 372
Reg: Feb 15, 2012
Montreal
10,720
09/21/12 01:56 PM (13 years ago)

AT53 Video Player

First off, I'd like to thank @ATRAIN53 for another solid plugin adding more native iOS functionality into application. First it was the AT53 Tweet Sheet and now it's the AT53 Video Player! I love the plugin and have incorporated within my application before sending it off to the folks of Apple! Two "minor" things that I noticed: 1) I was not able to use a YouTube link as the URL. The video would not play within the app. I was able to work around this by simply downloading the video into an .mp4 format and draging it to the BT Videos folder in Xcode and compiling. 2) If the ringer is off (i.e. vibrate/silent), the embedded video will not play sound. Once more, very minor issues that do not affect the user experience all that tremendously, but just a heads up! :) Anyways, thank you so much for yet another beautiful application. If my app gets approved this time around, it will be thanks to the wonderful people contributing to the wonderful plugin market ;) Thanks again! Nicholas
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
09/21/12 02:21 PM (13 years ago)
Awesome! Just got the notice that it was approved a little while ago. Thanks BT gang! I originally designed this for local videos only, David added the extra URL functionality. I have yet to see the code/mods he made. I just saw that he wrote the code for Android as well. Super cool. Dying to play with that now myself. Let me pull it down later today and play with it myself tonight a bit before I can try to answer any questions @ it. It's kinda like taking your car to the mechanic and it comes out of the shop a lot spiffier than when it went in. Always a nice treat, but I haven't peeked under the hood yet to see what he added. Thanks David, you are the best. Hopefully this makes adding video to apps a lot easier, I think we all want that.
 
GraciousWolf_PE
Aspiring developer
Profile
Posts: 372
Reg: Feb 15, 2012
Montreal
10,720
like
09/21/12 02:27 PM (13 years ago)
Besides those 2 points, the plugin runs very smoothly and does indeed make adding videos to applications a piece of cake process! Enjoy taking a look under the hood, it came into the shop already looking top notch! All the best with your plugin. Nicholas
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
09/21/12 10:50 PM (13 years ago)
@GraciousWolf_PE: Cool, glad you got this working. A few thoughts... Apple and YouTube are not buddies these days. It wouldn't surprise me a bit if YouTube vidoes stop laying all together in any future iOS device. Crazy, but possible. This of course has zero to do with this plugin. I'm thinking the YouTube URL you tried to use lead to a web page and not a video. YouTube very rarely makes the videos' on their site available via a direct URL. Direct meaning a URL that loads ONLY the media and no the entire webpage. If you point a media player at a webpage for sure it won't do anything, it expects media only, not HTML :-) Cool that you figured out how to grab the actual video from the URL, good work. If you want to use a URL, you could plop that video on a DropBox account or something and go from there? "If the ringer is off (i.e. vibrate/silent), the embedded video will not play sound": Yup, makes perfect sense. This idea is related to iOS and they way it handles "Audio Sessions" in the application itself. In other words, you can setup an Audio Session for the app (normally in the App's delegate file) that says to iOS: "Hey, do this with audio or video when the vibrate / silent switch is toggled" Understanding this is key. This means that this feature / behavior is not related to your actual player screen but instead related to your app's overall approach to Audio / Video playback. We've often considered adding these types of choices to your apps Core Settings but haven't got that far yet. Stay stoked, more cool stuff in the pipeline from ATRAIN53, dudes kickin' some butt!
 
GraciousWolf_PE
Aspiring developer
Profile
Posts: 372
Reg: Feb 15, 2012
Montreal
10,720
like
09/22/12 12:01 AM (13 years ago)
Hey David, Yeah, you're absolutely right, I linked the URL to the entire webpage of the video and not ONLY the video itself. Previously I had used the "Launch with Native App", which used YouTube to open up the video. The AT53 Video Plugin is a superior and much preferred alternative to video viewing, especially now that YouTube and Apple aren't on the best of terms, as already stated. Also, Firefox has always had some really easy to use plugins including the "Easy To Use Youtube Downloader" - all I had to do is click download and choose .mp4 format! Thanks for the URL suggestion, I don't mind having to compile the video on Xcode. I brought up the ringer off topic simply because on when playing a video on YouTube or music on your iOS device, you were able to hear the audio even if the ringer was off. It's no big deal at the end of the day and I understand completely (well, for the most part anyways!) the whole idea behind the Core Settings regarding the App's delegate file ;) Thanks for the brief overview! Ever since the plugin market has been implemented, I find myself coming back on BuzzTouch multiple times a day eagerly anticipating what's to come next from a very talented community. With all the plugins coming into play, if (hopefully a question of when) my app hits the store, updates might be in order sooner rather than later! ;) It goes without saying, thanks for making my first app building experience one of a kind! Nicholas
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
09/22/12 09:03 AM (13 years ago)
Thanks for the kind words, cool to hear how much you like this and I'm pretty amazed myself at what David added to this. I'm anxious to see your app get approved so we know they like the code! I got a chance to tinker with the official release a little last night and was loving the text in addition to the preview/thumbnail image to intro the video. Very nice touch David. I'm all abut local video, youtube is great but having full control over the video experience and not hiving to worry about bandwidth and as you say KEEPING PEOPLE IN THE APP - that was a main goal of the plug-in to start. Agreed on the plug-in market, the Plug-in Creator tool to start these things off was MONEY. What to strart cooking next. Thanks again David, you are amazing.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/22/12 12:59 PM (13 years ago)
I'm guessing the answer to this is no, but I figured I'd ask anyway. Is there a way to dynamically load a video? In other words, could we point to a url that uses php to show a video decided by the server? Or is there a way to dynamically load a playlist?
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
09/23/12 08:22 AM (13 years ago)
playlist support. interesting idea. dynamic video also interesting. both of those do seem possible using some JSON parsing to generate a valid URL that results in a link to a video. never hurts to ask and I like the ideas. adding these to list for future updates/improvements. thanks.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
09/24/12 01:40 AM (13 years ago)
@chris1: Both of these idea are possible. They are different idea but the concept is the same. a) You have video content on a server, in a directory probably. b) You have a menu of videos listed in the app c) Tap an item, video plays. So far so good. Next, there are two ideas here. Firstly, to create a dynamic list of videos to play, like a playlist powered by a backend..you would use a menu plugin and set it's data url property to a script on your server. You would not enter each row in the control panel for the menu, you would provide them with the script. The script would output the child items, one for each video. For each childItem (the menu items) in your php output, you would NOT use the loadScreenItemid or the loadScreenNickname (because they dont' exist in the apps master JSON in the config.txt file) but instead you would use the loadScreenObject property. Each item int he list object in the list would look something like... "childItems":[ {"itemId":"1", "itemType":"BT_menuItem", "imageTitle":"play video 1", "loadScreenObject":{{"itemId":"11", "itemType":"At53_video_player", "videoDescription":"description 1", "videoURL"url to video 1.mp4"}}, {"itemId":"2", "itemType":"BT_menuItem", "imageTitle":"play video 2", "loadScreenObject":{{"itemId":"22", "itemType":"At53_video_player", "videoDescription":"description 2", "videoURL"url to video 2.mp4"}}, ] See how that works? You're loading a screen dynamically, it doesn't exist yet! The other idea, about providing video's dynamically is a bit different. For this idea you would use the videoURL property for a video that pointed to a php script that grabbed the id of the video, found it on your server, then output it to the device. This is tricky because the content type and media output is very very tough to create in a way that the device recognizes as a video file. In other words, "outputting .mp4 content" is tough. There are ways to do this and it's doable, it's just tough. The device doesn't care if you're pointing to an actual file, a stream, or anything else. All it cares about is the data provided. If it's getting the right kind of content (media type, content type, etc) it wont' know the difference.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/24/12 06:30 AM (13 years ago)
David, That sounds really promising. It sounds like even if the videos aren't hosted on my webserver, as long as the server contains the direct links to the videos it should work. So, do I understand you correctly that this method will work today if I install the plugin? Or is this a hypothetical update that ATrain53 could make? I don't have a lot of experience with JSON - in fact I haven't used it with Buzztouch at all yet. Will this work on both iOS and Android? I realize I'm now at the point of needing "further education"! So far I've been learning as I go along. I went through the BuzzTouch Learning Path videos, but then started trying things myself. Looks like it's time do go back and do the rest of them.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/24/12 06:36 AM (13 years ago)
Okay, after looking at the plugin options for the 2 Menu plugins, it looks pretty straightforward to do what David suggests. Will this method cache for offline use, or does the menu screen need an internet connection to even show when loading from a url?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
09/24/12 09:12 AM (13 years ago)
@chris1: If you use a data URL to power a menu list it will need an internet connection "the first time" it loads to build the list. Pulling down the list will refresh it's items from the URL. Items will be cached on the device for offline use. The screens you "point to" from the menu (like a quiz, a video, whatever) may or may not cache and work offline, it depends on their content. I know the ATRAIN53 video player does NOT cache videos for offline use. This means if you build a dynamic list of videos each video will require an internet connection to load and play.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/24/12 05:01 PM (13 years ago)
Thanks David - that's exactly what I needed to know! I see you've created a lot more work for me now, but it will pay off dividends in the end - not just for this plugin but for the entire app! Of course this raises some more questions - do the buzztouch ID's need to be in a certain format? I noticed the ID's on my config.txt file are really long (23 characters if I remember right). Is that just to make really really really sure there are no duplicates? If I were to build a config.txt server-side, could I use incremental ID's? Are duplicates only a problem within the current app, or across my account, or across all of buzztouch.com? Sorry for all the questions - you just got the gears working! :)
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
09/25/12 01:49 AM (13 years ago)
No sorries needed..."really really really sure there are no duplicates" So love this, major smile. The id's in the config.txt file you see in your control panel correspond to database unique id's on our end. We use an interesting routine to create these, and yes they are very long! There is not enforced id syntax, you could use anything. In many cases they don't even have to be unique. Example: You could have a tab with "itemId":"1" and screen with "itemId":"1" and the app would not care. You dont' want two tabs, or screens, or other "like items" with the same id. It's generally best to stick with some sort of naming convention so you dont' get confused when you have a-ga-zillion screens. Most folks just use their id from their database (assuming the are doing this in ways outside the buzztouch control panel). If you use our control panel, just leave them as is.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
10/14/12 01:34 PM (13 years ago)
sorry to resurrect an old thread here that went off topic, but I'm working through a few kinks in my app before going live here soon (hopefully!) David, I was able to set up a dynamic list of video files using your method described above. I created a menu item using Susan's "WB_screen_menuImage" plugin, and used the 'dataURL' property to request the server to generate a list of child items that include the loadScreenObject property to create AT53Video screens. So far so good - the list generated exactly as expected and the videos play great. Now, how do I get the app to refresh the list? I noticed you said the list can be refreshed by pulling it down and triggering an in-app refresh by the user. But, is there not a way of forcing the list to refresh automatically when it is opened? I tried using a "forceRefresh" property and setting it to "1", but that didn't seem to do anything. The only workarounds I can think of right now are to 1) put a note in the app to tell users to manually pull the list down to refresh (since not all users will know to do that), or 2) force an entire app refresh every time a new video is added to the webserver by manipulating the Report to Cloud URL file. Neither is great, in my opinion, since new videos will be added on a weekly basis. Am I missing something?
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.