Skip to content

Conversation

@ofTheo
Copy link
Member

@ofTheo ofTheo commented Oct 17, 2024

As discussed in #8143 this adds the load( std::string ) function to ofBaseVideoPlayer class so that older video players will still work when used with 0.13 and on.

Tested both with using via ofVideoPlayer and directly.
Seems to work great and should allow for both newer path implementation and older legacy approaches.

cc @dimitre @roymacdonald


//---------------------------------------------------------------------------
void ofBaseVideoPlayer::loadAsync(const of::filesystem::path & fileName){
loadAsync(fileName.string());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can use ofPathToString(fileName) here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. the string() function can throw exceptions and because of that the ofPathToString handles it. In the switch to use fs::path we should enforce the use of ofPathToString rather than calling string() directly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh good catch! thanks guys!

@ofTheo ofTheo merged commit 20f16fe into openframeworks:master Oct 17, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants